diff options
author | JOGAMP DEV TEAM <[email protected]> | 2010-04-22 21:12:36 -0400 |
---|---|---|
committer | JOGAMP DEV TEAM <[email protected]> | 2010-04-22 21:12:36 -0400 |
commit | 1d889ddc4728d1534e310b44fad74a2932d22d39 (patch) | |
tree | 4ad0c3eeb3ef728522ac9459eb12c667301a0c32 | |
parent | 8790075f074013aa3c71b96993838cf1117275f1 (diff) | |
parent | a588326d206ff32e5ff5db97560851cb9b826022 (diff) |
Merge branch 'master' of github.com:sgothel/jogl
-rw-r--r-- | .gitignore | 5 | ||||
-rwxr-xr-x | CHANGELOG.txt | 3 | ||||
-rw-r--r-- | doc/bouml/html-svg/classdiagrams.html | 22 | ||||
-rw-r--r-- | doc/bouml/html-svg/classes.html | 44 | ||||
-rw-r--r-- | doc/bouml/html-svg/classes_list.html | 47 | ||||
-rw-r--r-- | doc/bouml/html-svg/fig128069.svg | 437 | ||||
-rw-r--r-- | doc/bouml/html-svg/index-withframe.html | 19 | ||||
-rw-r--r-- | doc/bouml/html-svg/index.html | 238 | ||||
-rw-r--r-- | doc/bouml/html-svg/index_65.html | 23 | ||||
-rw-r--r-- | doc/bouml/html-svg/index_67.html | 24 | ||||
-rw-r--r-- | doc/bouml/html-svg/index_71.html | 42 | ||||
-rw-r--r-- | doc/bouml/html-svg/index_74.html | 24 | ||||
-rw-r--r-- | doc/bouml/html-svg/index_78.html | 23 | ||||
-rw-r--r-- | doc/bouml/html-svg/index_79.html | 23 | ||||
-rw-r--r-- | doc/bouml/html-svg/index_82.html | 23 | ||||
-rw-r--r-- | doc/bouml/html-svg/navig.html | 17 | ||||
-rw-r--r-- | doc/bouml/html-svg/packages.html | 22 | ||||
-rw-r--r-- | doc/bouml/html-svg/style.css | 30 | ||||
-rw-r--r-- | doc/bouml/html/classes.html | 7 | ||||
-rw-r--r-- | doc/bouml/html/classes_list.html | 7 | ||||
-rw-r--r-- | doc/bouml/html/fig128069.png | bin | 67934 -> 80497 bytes | |||
-rw-r--r-- | doc/bouml/html/fig128069.svg | 350 | ||||
-rw-r--r-- | doc/bouml/html/index-withframe.html | 2 | ||||
-rw-r--r-- | doc/bouml/html/index.html | 73 | ||||
-rw-r--r-- | doc/bouml/html/index_71.html | 7 | ||||
-rw-r--r-- | doc/bouml/html/navig.html | 2 | ||||
-rw-r--r-- | doc/bouml/jogl/128069.diagram | 140 | ||||
-rw-r--r-- | doc/bouml/jogl/2.session | 11 | ||||
-rw-r--r-- | doc/bouml/jogl/jogl.prj | 176 | ||||
-rw-r--r-- | doc/deployment/JOGL-JAR-BUNDELING.txt | 138 | ||||
-rw-r--r-- | doc/deployment/lstjars/lstjars.linux_amd64-20100406.log | 540 | ||||
-rw-r--r-- | doc/deployment/lstjars/lstjars.linux_amd64-20100420.log | 524 | ||||
-rw-r--r-- | doc/userguide/index.html | 2 | ||||
-rw-r--r-- | doc/wiki/FAQ.xml | 8 | ||||
-rw-r--r-- | doxygen/doxygen-all-dev.cfg | 2 | ||||
-rw-r--r-- | doxygen/doxygen-all-pub.cfg | 4 | ||||
-rwxr-xr-x | etc/profile.jogl | 36 | ||||
-rw-r--r-- | jnlp-files/jogl-all-awt.jnlp | 1 | ||||
-rw-r--r-- | jnlp-files/jogl-all-noawt.jnlp | 1 | ||||
-rw-r--r-- | jnlp-files/jogl-awt.jnlp | 1 | ||||
-rw-r--r-- | jnlp-files/jogl-core.jnlp | 1 | ||||
-rw-r--r-- | jnlp-files/jogl-gl2es12.jnlp | 1 | ||||
-rw-r--r-- | jnlp-files/nativewindow-all-awt.jnlp | 1 | ||||
-rw-r--r-- | jnlp-files/nativewindow-awt.jnlp | 1 | ||||
-rw-r--r-- | jnlp-files/nativewindow.jnlp | 1 | ||||
-rw-r--r-- | jnlp-files/newt-all-awt.jnlp | 1 | ||||
-rw-r--r-- | jnlp-files/newt-all-noawt.jnlp | 1 | ||||
-rw-r--r-- | jnlp-files/newt-awt.jnlp | 1 | ||||
-rw-r--r-- | jnlp-files/newt-jogl.jnlp | 1 | ||||
-rw-r--r-- | jnlp-files/newt.jnlp | 1 | ||||
-rw-r--r-- | jogl.iml | 19 | ||||
-rw-r--r-- | make/build-common.xml | 345 | ||||
-rw-r--r-- | make/build-gluegen.xml | 4 | ||||
-rw-r--r-- | make/build-jogl.xml | 890 | ||||
-rw-r--r-- | make/build-junit.xml | 195 | ||||
-rw-r--r-- | make/build-nativewindow.xml | 317 | ||||
-rw-r--r-- | make/build-newt.xml | 364 | ||||
-rw-r--r-- | make/build-staticglgen.xml | 12 | ||||
-rw-r--r-- | make/build.xml | 170 | ||||
-rwxr-xr-x | make/config/jogl/cg-common-CustomJavaCode.java | 2 | ||||
-rw-r--r-- | make/config/jogl/cg-common.cfg | 8 | ||||
-rw-r--r-- | make/config/jogl/cgl-macosx.cfg | 2 | ||||
-rwxr-xr-x | make/config/jogl/cglext.cfg | 4 | ||||
-rw-r--r-- | make/config/jogl/egl-common.cfg | 3 | ||||
-rwxr-xr-x | make/config/jogl/egl.cfg | 6 | ||||
-rwxr-xr-x | make/config/jogl/eglext.cfg | 6 | ||||
-rw-r--r-- | make/config/jogl/gl-common.cfg | 11 | ||||
-rwxr-xr-x | make/config/jogl/gl-desktop.cfg | 2 | ||||
-rwxr-xr-x | make/config/jogl/gl-es1.cfg | 4 | ||||
-rwxr-xr-x | make/config/jogl/gl-es2.cfg | 4 | ||||
-rw-r--r-- | make/config/jogl/gl-gl2.cfg | 48 | ||||
-rw-r--r-- | make/config/jogl/gl-gl2es12.cfg | 4 | ||||
-rw-r--r-- | make/config/jogl/gl-gl3.cfg | 45 | ||||
-rw-r--r-- | make/config/jogl/gl-gl3bc.cfg | 65 | ||||
-rw-r--r-- | make/config/jogl/gl-gl4.cfg | 37 | ||||
-rw-r--r-- | make/config/jogl/gl-gl4bc.cfg | 110 | ||||
-rw-r--r-- | make/config/jogl/gl-impl-CustomCCode-gl2es12.c | 8 | ||||
-rw-r--r-- | make/config/jogl/gl-impl-CustomCCode-gl3.c | 24 | ||||
-rw-r--r-- | make/config/jogl/gl-impl-CustomCCode-gl3bc.c | 24 | ||||
-rw-r--r-- | make/config/jogl/gl-impl-CustomCCode-gl4bc.c (renamed from make/config/jogl/gl-impl-CustomCCode-gl2.c) | 8 | ||||
-rw-r--r-- | make/config/jogl/gl-impl-CustomCCode-gles1.c | 8 | ||||
-rw-r--r-- | make/config/jogl/gl-impl-CustomCCode-gles2.c | 8 | ||||
-rw-r--r-- | make/config/jogl/gl-impl-CustomJavaCode-common.java | 74 | ||||
-rw-r--r-- | make/config/jogl/gl-impl-CustomJavaCode-desktop.java | 250 | ||||
-rw-r--r-- | make/config/jogl/gl-impl-CustomJavaCode-gl2.java | 498 | ||||
-rw-r--r-- | make/config/jogl/gl-impl-CustomJavaCode-gl2es12.java | 49 | ||||
-rw-r--r-- | make/config/jogl/gl-impl-CustomJavaCode-gl4.java (renamed from make/config/jogl/gl-impl-CustomJavaCode-gl3.java) | 113 | ||||
-rw-r--r-- | make/config/jogl/gl-impl-CustomJavaCode-gl4bc.java (renamed from make/config/jogl/gl-impl-CustomJavaCode-gl3bc.java) | 117 | ||||
-rwxr-xr-x | make/config/jogl/gl-impl-CustomJavaCode-gles1.java | 51 | ||||
-rwxr-xr-x | make/config/jogl/gl-impl-CustomJavaCode-gles2.java | 51 | ||||
-rw-r--r-- | make/config/jogl/gl3-common.cfg | 3 | ||||
-rwxr-xr-x | make/config/jogl/gl3-desktop.cfg | 2 | ||||
-rwxr-xr-x | make/config/jogl/gl3ext-headers.cfg | 5 | ||||
-rw-r--r-- | make/config/jogl/gl4-common.cfg | 5 | ||||
-rw-r--r-- | make/config/jogl/gl4-desktop-tracker.cfg (renamed from make/config/jogl/gl3-desktop-tracker.cfg) | 0 | ||||
-rwxr-xr-x | make/config/jogl/glu-CustomJavaCode-base.java | 4 | ||||
-rwxr-xr-x | make/config/jogl/glu-CustomJavaCode-gl2es1.java | 2 | ||||
-rwxr-xr-x | make/config/jogl/glu-base.cfg | 4 | ||||
-rw-r--r-- | make/config/jogl/glu-common.cfg | 9 | ||||
-rwxr-xr-x | make/config/jogl/glu-gl2.cfg | 14 | ||||
-rwxr-xr-x | make/config/jogl/glu-gl2es1.cfg | 2 | ||||
-rwxr-xr-x | make/config/jogl/glx-CustomCCode.c | 31 | ||||
-rw-r--r-- | make/config/jogl/glx-CustomJavaCode.java | 8 | ||||
-rw-r--r-- | make/config/jogl/glx-x11.cfg | 4 | ||||
-rwxr-xr-x | make/config/jogl/glxext.cfg | 8 | ||||
-rw-r--r-- | make/config/jogl/wgl-win32.cfg | 2 | ||||
-rw-r--r-- | make/config/jogl/wglext.cfg | 4 | ||||
-rwxr-xr-x | make/config/nativewindow/jawt-DrawingSurfaceInfo-CustomJavaCode.java | 6 | ||||
-rw-r--r-- | make/config/nativewindow/jawt-macosx.cfg | 6 | ||||
-rw-r--r-- | make/config/nativewindow/jawt-win32.cfg | 6 | ||||
-rw-r--r-- | make/config/nativewindow/jawt-x11.cfg | 6 | ||||
-rwxr-xr-x | make/config/nativewindow/x11-CustomCCode.c | 169 | ||||
-rw-r--r-- | make/config/nativewindow/x11-CustomJavaCode.java | 16 | ||||
-rw-r--r-- | make/config/nativewindow/x11-lib.cfg | 21 | ||||
-rwxr-xr-x | make/java-run-newt.sh | 28 | ||||
-rwxr-xr-x | make/java-run.sh | 19 | ||||
-rw-r--r-- | make/java-win32-dbg.bat | 16 | ||||
-rw-r--r-- | make/java-win32.bat | 16 | ||||
-rw-r--r-- | make/jogl.properties | 2 | ||||
-rw-r--r-- | make/joglversion | 4 | ||||
-rw-r--r-- | make/joglversion-cdc | 4 | ||||
-rw-r--r-- | make/lib/gluegen.compiler.intelgdl.xml | 11 | ||||
-rw-r--r-- | make/lstjars.sh | 133 | ||||
-rw-r--r-- | make/make.jogl.all.linux-x86.sh | 1 | ||||
-rw-r--r-- | make/make.jogl.all.linux-x86_64.sh | 5 | ||||
-rw-r--r-- | make/make.jogl.all.win32.bat | 15 | ||||
-rw-r--r-- | make/make.jogl.all.win64.bat | 17 | ||||
-rw-r--r-- | make/make.jogl.cdcfp.linux-x86.sh | 1 | ||||
-rw-r--r-- | make/newtRIversion | 2 | ||||
-rw-r--r-- | make/newtRIversion-cdc | 2 | ||||
-rw-r--r-- | make/newtversion | 2 | ||||
-rw-r--r-- | make/newtversion-cdc | 2 | ||||
-rwxr-xr-x | make/scripts/all-deploy-webstarttest.sh | 38 | ||||
-rwxr-xr-x | make/scripts/deploy-jars_external-webstarttest.sh | 26 | ||||
-rwxr-xr-x | make/scripts/deploy-jnlp-webstarttest.sh | 3 | ||||
-rw-r--r-- | make/setenv-jogl.sh | 92 | ||||
-rwxr-xr-x | make/setvc9-jogl.bat | 4 | ||||
-rwxr-xr-x | make/stub_includes/egl/EGL/egl.h | 8 | ||||
-rw-r--r-- | make/stub_includes/opengl/gl3-64bit-types.h | 2 | ||||
-rw-r--r-- | make/stub_includes/opengl/gl4.c | 11 | ||||
-rw-r--r-- | make/stub_includes/opengl/gl4bc.c | 18 | ||||
-rw-r--r-- | make/stub_includes/win32/wingdi.h | 2 | ||||
-rw-r--r-- | make/stub_includes/x11/window-lib.c | 3 | ||||
-rw-r--r-- | make/versions.xml | 3 | ||||
-rw-r--r-- | nativewindow.iml | 18 | ||||
-rwxr-xr-x | nbproject/project.xml | 27 | ||||
-rw-r--r-- | newt.iml | 15 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/audio/windows/waveout/Audio.java (renamed from src/jogl/classes/com/sun/javafx/audio/windows/waveout/Audio.java) | 2 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/audio/windows/waveout/Mixer.java (renamed from src/jogl/classes/com/sun/javafx/audio/windows/waveout/Mixer.java) | 2 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/audio/windows/waveout/SoundBuffer.java (renamed from src/jogl/classes/com/sun/javafx/audio/windows/waveout/SoundBuffer.java) | 2 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/audio/windows/waveout/TestSpatialization.java (renamed from src/jogl/classes/com/sun/javafx/audio/windows/waveout/TestSpatialization.java) | 3 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/audio/windows/waveout/Track.java (renamed from src/jogl/classes/com/sun/javafx/audio/windows/waveout/Track.java) | 2 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/audio/windows/waveout/Vec3f.java (renamed from src/jogl/classes/com/sun/javafx/audio/windows/waveout/Vec3f.java) | 2 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/cg/CgException.java (renamed from src/jogl/classes/com/sun/opengl/cg/CgException.java) | 2 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/impl/DRIHack.java (renamed from src/jogl/classes/com/sun/opengl/impl/DRIHack.java) | 48 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/Debug.java (renamed from src/jogl/classes/com/sun/opengl/impl/Debug.java) | 2 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/ExtensionAvailabilityCache.java (renamed from src/jogl/classes/com/sun/opengl/impl/ExtensionAvailabilityCache.java) | 223 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/impl/GLBufferSizeTracker.java (renamed from src/jogl/classes/com/sun/opengl/impl/GLBufferSizeTracker.java) | 2 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/impl/GLBufferStateTracker.java (renamed from src/jogl/classes/com/sun/opengl/impl/GLBufferStateTracker.java) | 2 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/GLContextImpl.java (renamed from src/jogl/classes/com/sun/opengl/impl/GLContextImpl.java) | 653 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/GLContextLock.java (renamed from src/jogl/classes/com/sun/opengl/impl/GLContextLock.java) | 2 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/GLContextShareSet.java (renamed from src/jogl/classes/com/sun/opengl/impl/GLContextShareSet.java) | 2 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/GLDrawableFactoryImpl.java (renamed from src/jogl/classes/com/sun/opengl/impl/GLDrawableFactoryImpl.java) | 46 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/GLDrawableHelper.java (renamed from src/jogl/classes/com/sun/opengl/impl/GLDrawableHelper.java) | 2 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/GLDrawableImpl.java (renamed from src/jogl/classes/com/sun/opengl/impl/GLDrawableImpl.java) | 14 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/GLJNILibLoader.java (renamed from src/jogl/classes/com/sun/opengl/impl/NativeLibLoader.java) | 8 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/GLPbufferImpl.java (renamed from src/jogl/classes/com/sun/opengl/impl/GLPbufferImpl.java) | 2 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/impl/GLStateTracker.java (renamed from src/jogl/classes/com/sun/opengl/impl/GLStateTracker.java) | 29 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/impl/GLWorkerThread.java (renamed from src/jogl/classes/com/sun/opengl/impl/GLWorkerThread.java) | 2 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/InternalBufferUtil.java.javame_cdc_fp (renamed from src/jogl/classes/com/sun/opengl/impl/InternalBufferUtil.java.javame_cdc_fp) | 4 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/InternalBufferUtil.java.javase (renamed from src/jogl/classes/com/sun/opengl/impl/InternalBufferUtil.java.javase) | 4 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/impl/ProjectFloat.java (renamed from src/jogl/classes/com/sun/opengl/impl/ProjectFloat.java) | 4 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/SystemUtil.java.javame_cdc_fp (renamed from src/jogl/classes/com/sun/opengl/impl/SystemUtil.java.javame_cdc_fp) | 2 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/SystemUtil.java.javase (renamed from src/jogl/classes/com/sun/opengl/impl/SystemUtil.java.javase) | 2 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/ThreadingImpl.java (renamed from src/jogl/classes/com/sun/opengl/impl/ThreadingImpl.java) | 13 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/ThreadingPlugin.java (renamed from src/jogl/classes/com/sun/opengl/impl/ThreadingPlugin.java) | 2 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/impl/awt/AWTThreadingPlugin.java (renamed from src/jogl/classes/com/sun/opengl/impl/awt/AWTThreadingPlugin.java) | 4 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/awt/AWTUtil.java (renamed from src/jogl/classes/com/sun/opengl/impl/awt/AWTUtil.java) | 8 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/impl/awt/Java2D.java (renamed from src/jogl/classes/com/sun/opengl/impl/awt/Java2D.java) | 4 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/awt/Java2DGLContext.java (renamed from src/jogl/classes/com/sun/opengl/impl/awt/Java2DGLContext.java) | 4 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/impl/egl/EGLContext.java (renamed from src/jogl/classes/com/sun/opengl/impl/egl/EGLContext.java) | 39 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/impl/egl/EGLDrawable.java (renamed from src/jogl/classes/com/sun/opengl/impl/egl/EGLDrawable.java) | 9 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/impl/egl/EGLDrawableFactory.java (renamed from src/jogl/classes/com/sun/opengl/impl/egl/EGLDrawableFactory.java) | 24 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/impl/egl/EGLDynamicLookupHelper.java (renamed from src/jogl/classes/com/sun/opengl/impl/egl/EGLDynamicLookupHelper.java) | 27 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/impl/egl/EGLES1DynamicLookupHelper.java (renamed from src/jogl/classes/com/sun/opengl/impl/egl/EGLES1DynamicLookupHelper.java) | 7 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/impl/egl/EGLES2DynamicLookupHelper.java (renamed from src/jogl/classes/com/sun/opengl/impl/egl/EGLES2DynamicLookupHelper.java) | 7 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/impl/egl/EGLExternalContext.java (renamed from src/jogl/classes/com/sun/opengl/impl/egl/EGLExternalContext.java) | 6 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/egl/EGLGraphicsConfiguration.java (renamed from src/jogl/classes/com/sun/opengl/impl/egl/EGLGraphicsConfiguration.java) | 81 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/egl/EGLGraphicsConfigurationFactory.java (renamed from src/jogl/classes/com/sun/opengl/impl/egl/EGLGraphicsConfigurationFactory.java) | 30 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/impl/egl/EGLOnscreenContext.java (renamed from src/jogl/classes/com/sun/opengl/impl/egl/EGLOnscreenContext.java) | 6 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/egl/EGLOnscreenDrawable.java (renamed from src/jogl/classes/com/sun/opengl/impl/egl/EGLOnscreenDrawable.java) | 32 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/impl/egl/EGLPbufferContext.java (renamed from src/jogl/classes/com/sun/opengl/impl/egl/EGLPbufferContext.java) | 6 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/egl/EGLPbufferDrawable.java (renamed from src/jogl/classes/com/sun/opengl/impl/egl/EGLPbufferDrawable.java) | 6 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/impl/gl2/ProjectDouble.java (renamed from src/jogl/classes/com/sun/opengl/impl/gl2/ProjectDouble.java) | 6 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/gl2/Util.java (renamed from src/jogl/classes/com/sun/opengl/impl/gl2/Util.java) | 4 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/impl/gl2/fixme/GLObjectTracker.java (renamed from src/jogl/classes/com/sun/opengl/impl/gl2/fixme/GLObjectTracker.java) | 4 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/glu/GLUquadricImpl.java (renamed from src/jogl/classes/com/sun/opengl/impl/glu/GLUquadricImpl.java) | 6 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/impl/glu/Glue.java (renamed from src/jogl/classes/com/sun/opengl/impl/glu/Glue.java) | 4 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/glu/error/Error.java (renamed from src/jogl/classes/com/sun/opengl/impl/glu/error/Error.java) | 6 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/impl/glu/gl2/nurbs/GL2Backend.java (renamed from src/jogl/classes/com/sun/opengl/impl/glu/gl2/nurbs/GL2Backend.java) | 6 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/impl/glu/gl2/nurbs/GL2CurveEvaluator.java (renamed from src/jogl/classes/com/sun/opengl/impl/glu/gl2/nurbs/GL2CurveEvaluator.java) | 6 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/impl/glu/gl2/nurbs/GL2SurfaceEvaluator.java (renamed from src/jogl/classes/com/sun/opengl/impl/glu/gl2/nurbs/GL2SurfaceEvaluator.java) | 6 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/impl/glu/gl2/nurbs/GLUgl2nurbsImpl.java (renamed from src/jogl/classes/com/sun/opengl/impl/glu/gl2/nurbs/GLUgl2nurbsImpl.java) | 6 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/BuildMipmap.java (renamed from src/jogl/classes/com/sun/opengl/impl/glu/mipmap/BuildMipmap.java) | 8 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/Extract.java (renamed from src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Extract.java) | 4 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/Extract1010102.java (renamed from src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Extract1010102.java) | 4 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/Extract1555rev.java (renamed from src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Extract1555rev.java) | 4 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/Extract2101010rev.java (renamed from src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Extract2101010rev.java) | 4 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/Extract233rev.java (renamed from src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Extract233rev.java) | 4 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/Extract332.java (renamed from src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Extract332.java) | 4 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/Extract4444.java (renamed from src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Extract4444.java) | 4 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/Extract4444rev.java (renamed from src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Extract4444rev.java) | 4 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/Extract5551.java (renamed from src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Extract5551.java) | 4 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/Extract565.java (renamed from src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Extract565.java) | 4 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/Extract565rev.java (renamed from src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Extract565rev.java) | 4 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/Extract8888.java (renamed from src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Extract8888.java) | 4 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/Extract8888rev.java (renamed from src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Extract8888rev.java) | 4 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/ExtractFloat.java (renamed from src/jogl/classes/com/sun/opengl/impl/glu/mipmap/ExtractFloat.java) | 4 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/ExtractPrimitive.java (renamed from src/jogl/classes/com/sun/opengl/impl/glu/mipmap/ExtractPrimitive.java) | 4 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/ExtractSByte.java (renamed from src/jogl/classes/com/sun/opengl/impl/glu/mipmap/ExtractSByte.java) | 4 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/ExtractSInt.java (renamed from src/jogl/classes/com/sun/opengl/impl/glu/mipmap/ExtractSInt.java) | 4 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/ExtractSShort.java (renamed from src/jogl/classes/com/sun/opengl/impl/glu/mipmap/ExtractSShort.java) | 4 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/ExtractUByte.java (renamed from src/jogl/classes/com/sun/opengl/impl/glu/mipmap/ExtractUByte.java) | 4 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/ExtractUInt.java (renamed from src/jogl/classes/com/sun/opengl/impl/glu/mipmap/ExtractUInt.java) | 4 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/ExtractUShort.java (renamed from src/jogl/classes/com/sun/opengl/impl/glu/mipmap/ExtractUShort.java) | 4 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/HalveImage.java (renamed from src/jogl/classes/com/sun/opengl/impl/glu/mipmap/HalveImage.java) | 4 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/Image.java (renamed from src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Image.java) | 4 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/Mipmap.java (renamed from src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Mipmap.java) | 293 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/PixelStorageModes.java (renamed from src/jogl/classes/com/sun/opengl/impl/glu/mipmap/PixelStorageModes.java) | 4 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/ScaleInternal.java (renamed from src/jogl/classes/com/sun/opengl/impl/glu/mipmap/ScaleInternal.java) | 6 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/Type_Widget.java (renamed from src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Type_Widget.java) | 4 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Arc.java (renamed from src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Arc.java) | 4 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/ArcSdirSorter.java (renamed from src/jogl/classes/com/sun/opengl/impl/glu/nurbs/ArcSdirSorter.java) | 4 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/ArcTdirSorter.java (renamed from src/jogl/classes/com/sun/opengl/impl/glu/nurbs/ArcTdirSorter.java) | 4 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/ArcTesselator.java (renamed from src/jogl/classes/com/sun/opengl/impl/glu/nurbs/ArcTesselator.java) | 4 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Backend.java (renamed from src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Backend.java) | 4 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/BezierArc.java (renamed from src/jogl/classes/com/sun/opengl/impl/glu/nurbs/BezierArc.java) | 4 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Bin.java (renamed from src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Bin.java) | 4 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Breakpt.java (renamed from src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Breakpt.java) | 4 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/CArrayOfArcs.java (renamed from src/jogl/classes/com/sun/opengl/impl/glu/nurbs/CArrayOfArcs.java) | 2 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/CArrayOfBreakpts.java (renamed from src/jogl/classes/com/sun/opengl/impl/glu/nurbs/CArrayOfBreakpts.java) | 2 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/CArrayOfFloats.java (renamed from src/jogl/classes/com/sun/opengl/impl/glu/nurbs/CArrayOfFloats.java) | 2 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/CArrayOfQuiltspecs.java (renamed from src/jogl/classes/com/sun/opengl/impl/glu/nurbs/CArrayOfQuiltspecs.java) | 2 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Curve.java (renamed from src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Curve.java) | 4 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/CurveEvaluator.java (renamed from src/jogl/classes/com/sun/opengl/impl/glu/nurbs/CurveEvaluator.java) | 4 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Curvelist.java (renamed from src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Curvelist.java) | 4 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/DisplayList.java (renamed from src/jogl/classes/com/sun/opengl/impl/glu/nurbs/DisplayList.java) | 4 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Flist.java (renamed from src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Flist.java) | 4 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Knotspec.java (renamed from src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Knotspec.java) | 4 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Knotvector.java (renamed from src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Knotvector.java) | 4 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Mapdesc.java (renamed from src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Mapdesc.java) | 4 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Maplist.java (renamed from src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Maplist.java) | 4 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/NurbsConsts.java (renamed from src/jogl/classes/com/sun/opengl/impl/glu/nurbs/NurbsConsts.java) | 4 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/O_curve.java (renamed from src/jogl/classes/com/sun/opengl/impl/glu/nurbs/O_curve.java) | 4 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/O_nurbscurve.java (renamed from src/jogl/classes/com/sun/opengl/impl/glu/nurbs/O_nurbscurve.java) | 4 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/O_nurbssurface.java (renamed from src/jogl/classes/com/sun/opengl/impl/glu/nurbs/O_nurbssurface.java) | 4 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/O_pwlcurve.java (renamed from src/jogl/classes/com/sun/opengl/impl/glu/nurbs/O_pwlcurve.java) | 4 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/O_surface.java (renamed from src/jogl/classes/com/sun/opengl/impl/glu/nurbs/O_surface.java) | 4 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/O_trim.java (renamed from src/jogl/classes/com/sun/opengl/impl/glu/nurbs/O_trim.java) | 4 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Patch.java (renamed from src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Patch.java) | 4 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Patchlist.java (renamed from src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Patchlist.java) | 4 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Property.java (renamed from src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Property.java) | 4 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Pspec.java (renamed from src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Pspec.java) | 4 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/PwlArc.java (renamed from src/jogl/classes/com/sun/opengl/impl/glu/nurbs/PwlArc.java) | 4 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Quilt.java (renamed from src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Quilt.java) | 4 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Quiltspec.java (renamed from src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Quiltspec.java) | 4 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/README.txt (renamed from src/jogl/classes/com/sun/opengl/impl/glu/nurbs/README.txt) | 0 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Renderhints.java (renamed from src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Renderhints.java) | 4 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Splinespec.java (renamed from src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Splinespec.java) | 4 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Subdivider.java (renamed from src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Subdivider.java) | 4 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/SurfaceEvaluator.java (renamed from src/jogl/classes/com/sun/opengl/impl/glu/nurbs/SurfaceEvaluator.java) | 4 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/TrimVertex.java (renamed from src/jogl/classes/com/sun/opengl/impl/glu/nurbs/TrimVertex.java) | 4 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/glu/registry/Registry.java (renamed from src/jogl/classes/com/sun/opengl/impl/glu/registry/Registry.java) | 4 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/ActiveRegion.java (renamed from src/jogl/classes/com/sun/opengl/impl/glu/tessellator/ActiveRegion.java) | 4 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/CachedVertex.java (renamed from src/jogl/classes/com/sun/opengl/impl/glu/tessellator/CachedVertex.java) | 4 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/Dict.java (renamed from src/jogl/classes/com/sun/opengl/impl/glu/tessellator/Dict.java) | 4 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/DictNode.java (renamed from src/jogl/classes/com/sun/opengl/impl/glu/tessellator/DictNode.java) | 4 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/GLUface.java (renamed from src/jogl/classes/com/sun/opengl/impl/glu/tessellator/GLUface.java) | 4 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/GLUhalfEdge.java (renamed from src/jogl/classes/com/sun/opengl/impl/glu/tessellator/GLUhalfEdge.java) | 8 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/GLUmesh.java (renamed from src/jogl/classes/com/sun/opengl/impl/glu/tessellator/GLUmesh.java) | 10 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/GLUtessellatorImpl.java (renamed from src/jogl/classes/com/sun/opengl/impl/glu/tessellator/GLUtessellatorImpl.java) | 6 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/GLUvertex.java (renamed from src/jogl/classes/com/sun/opengl/impl/glu/tessellator/GLUvertex.java) | 6 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/Geom.java (renamed from src/jogl/classes/com/sun/opengl/impl/glu/tessellator/Geom.java) | 4 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/Mesh.java (renamed from src/jogl/classes/com/sun/opengl/impl/glu/tessellator/Mesh.java) | 160 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/Normal.java (renamed from src/jogl/classes/com/sun/opengl/impl/glu/tessellator/Normal.java) | 22 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/PriorityQ.java (renamed from src/jogl/classes/com/sun/opengl/impl/glu/tessellator/PriorityQ.java) | 6 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/PriorityQHeap.java (renamed from src/jogl/classes/com/sun/opengl/impl/glu/tessellator/PriorityQHeap.java) | 40 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/PriorityQSort.java (renamed from src/jogl/classes/com/sun/opengl/impl/glu/tessellator/PriorityQSort.java) | 28 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/Render.java (renamed from src/jogl/classes/com/sun/opengl/impl/glu/tessellator/Render.java) | 56 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/Sweep.java (renamed from src/jogl/classes/com/sun/opengl/impl/glu/tessellator/Sweep.java) | 4 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/TessMono.java (renamed from src/jogl/classes/com/sun/opengl/impl/glu/tessellator/TessMono.java) | 4 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/TessState.java (renamed from src/jogl/classes/com/sun/opengl/impl/glu/tessellator/TessState.java) | 4 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/MacOSXCGLContext.java (renamed from src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXCGLContext.java) | 42 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/MacOSXCGLDrawable.java (renamed from src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXCGLDrawable.java) | 13 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/MacOSXCGLDrawableFactory.java (renamed from src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXCGLDrawableFactory.java) | 25 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/MacOSXCGLGraphicsConfiguration.java (renamed from src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXCGLGraphicsConfiguration.java) | 5 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/MacOSXCGLGraphicsConfigurationFactory.java (renamed from src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXCGLGraphicsConfigurationFactory.java) | 8 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/MacOSXExternalCGLContext.java (renamed from src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXExternalCGLContext.java) | 11 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/MacOSXOffscreenCGLContext.java (renamed from src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXOffscreenCGLContext.java) | 6 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/MacOSXOffscreenCGLDrawable.java (renamed from src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXOffscreenCGLDrawable.java) | 4 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/MacOSXOnscreenCGLContext.java (renamed from src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXOnscreenCGLContext.java) | 8 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/MacOSXOnscreenCGLDrawable.java (renamed from src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXOnscreenCGLDrawable.java) | 4 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/MacOSXPbufferCGLContext.java (renamed from src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXPbufferCGLContext.java) | 34 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/MacOSXPbufferCGLDrawable.java (renamed from src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXPbufferCGLDrawable.java) | 15 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/awt/MacOSXAWTCGLDrawableFactory.java (renamed from src/jogl/classes/com/sun/opengl/impl/macosx/cgl/awt/MacOSXAWTCGLDrawableFactory.java) | 11 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/awt/MacOSXAWTCGLGraphicsConfigurationFactory.java (renamed from src/jogl/classes/com/sun/opengl/impl/macosx/cgl/awt/MacOSXAWTCGLGraphicsConfigurationFactory.java) | 12 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/awt/MacOSXJava2DCGLContext.java (renamed from src/jogl/classes/com/sun/opengl/impl/macosx/cgl/awt/MacOSXJava2DCGLContext.java) | 21 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsDummyWGLDrawable.java (renamed from src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsDummyWGLDrawable.java) | 13 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsExternalWGLContext.java (renamed from src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsExternalWGLContext.java) | 12 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsExternalWGLDrawable.java (renamed from src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsExternalWGLDrawable.java) | 6 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsOffscreenWGLContext.java (renamed from src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsOffscreenWGLContext.java) | 4 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsOffscreenWGLDrawable.java (renamed from src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsOffscreenWGLDrawable.java) | 8 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsOnscreenWGLContext.java (renamed from src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsOnscreenWGLContext.java) | 4 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsOnscreenWGLDrawable.java (renamed from src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsOnscreenWGLDrawable.java) | 4 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsPbufferWGLContext.java (renamed from src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsPbufferWGLContext.java) | 6 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsPbufferWGLDrawable.java (renamed from src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsPbufferWGLDrawable.java) | 4 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsWGLContext.java (renamed from src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLContext.java) | 274 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsWGLDrawable.java (renamed from src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLDrawable.java) | 20 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsWGLDrawableFactory.java (renamed from src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLDrawableFactory.java) | 132 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsWGLGraphicsConfiguration.java (renamed from src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLGraphicsConfiguration.java) | 23 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java (renamed from src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java) | 66 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/awt/WindowsAWTWGLGraphicsConfigurationFactory.java (renamed from src/jogl/classes/com/sun/opengl/impl/windows/wgl/awt/WindowsAWTWGLGraphicsConfigurationFactory.java) | 12 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/x11/glx/GLXUtil.java (renamed from src/jogl/classes/com/sun/opengl/impl/x11/glx/GLXUtil.java) | 58 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11DummyGLXDrawable.java | 94 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11ExternalGLXContext.java (renamed from src/jogl/classes/com/sun/opengl/impl/x11/glx/X11ExternalGLXContext.java) | 10 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11ExternalGLXDrawable.java (renamed from src/jogl/classes/com/sun/opengl/impl/x11/glx/X11ExternalGLXDrawable.java) | 8 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLXContext.java (renamed from src/jogl/classes/com/sun/opengl/impl/x11/glx/X11GLXContext.java) | 417 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLXDrawable.java (renamed from src/jogl/classes/com/sun/opengl/impl/x11/glx/X11GLXDrawable.java) | 41 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLXDrawableFactory.java (renamed from src/jogl/classes/com/sun/opengl/impl/x11/glx/X11GLXDrawableFactory.java) | 235 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLXGraphicsConfiguration.java (renamed from src/jogl/classes/com/sun/opengl/impl/x11/glx/X11GLXGraphicsConfiguration.java) | 67 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLXGraphicsConfigurationFactory.java (renamed from src/jogl/classes/com/sun/opengl/impl/x11/glx/X11GLXGraphicsConfigurationFactory.java) | 283 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11OffscreenGLXContext.java (renamed from src/jogl/classes/com/sun/opengl/impl/x11/glx/X11OffscreenGLXContext.java) | 8 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11OffscreenGLXDrawable.java (renamed from src/jogl/classes/com/sun/opengl/impl/x11/glx/X11OffscreenGLXDrawable.java) | 113 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11OnscreenGLXContext.java (renamed from src/jogl/classes/com/sun/opengl/impl/x11/glx/X11OnscreenGLXContext.java) | 6 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11OnscreenGLXDrawable.java (renamed from src/jogl/classes/com/sun/opengl/impl/x11/glx/X11OnscreenGLXDrawable.java) | 6 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11PbufferGLXContext.java (renamed from src/jogl/classes/com/sun/opengl/impl/x11/glx/X11PbufferGLXContext.java) | 35 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11PbufferGLXDrawable.java (renamed from src/jogl/classes/com/sun/opengl/impl/x11/glx/X11PbufferGLXDrawable.java) | 8 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/x11/glx/awt/X11AWTGLXGraphicsConfigurationFactory.java (renamed from src/jogl/classes/com/sun/opengl/impl/x11/glx/awt/X11AWTGLXGraphicsConfigurationFactory.java) | 16 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/util/AWTAnimatorImpl.java (renamed from src/jogl/classes/com/sun/opengl/util/AWTAnimatorImpl.java) | 2 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/util/Animator.java (renamed from src/jogl/classes/com/sun/opengl/util/Animator.java) | 6 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/util/AnimatorImpl.java (renamed from src/jogl/classes/com/sun/opengl/util/AnimatorImpl.java) | 2 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/util/FBObject.java (renamed from src/jogl/classes/com/sun/opengl/util/FBObject.java) | 2 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/util/FPSAnimator.java (renamed from src/jogl/classes/com/sun/opengl/util/FPSAnimator.java) | 2 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/util/FileUtil.java (renamed from src/jogl/classes/com/sun/opengl/util/FileUtil.java) | 2 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/util/FixedPoint.java (renamed from src/jogl/classes/com/sun/opengl/util/FixedPoint.java) | 2 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/util/GLArrayDataClient.java (renamed from src/jogl/classes/com/sun/opengl/util/GLArrayDataClient.java) | 27 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/util/GLArrayDataEditable.java (renamed from src/jogl/classes/com/sun/opengl/util/GLArrayDataEditable.java) | 2 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/util/GLArrayDataServer.java (renamed from src/jogl/classes/com/sun/opengl/util/GLArrayDataServer.java) | 4 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/util/GLArrayDataWrapper.java (renamed from src/jogl/classes/com/sun/opengl/util/GLArrayDataWrapper.java) | 12 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/util/GLArrayHandler.java (renamed from src/jogl/classes/com/sun/opengl/util/GLArrayHandler.java) | 2 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/util/GLBuffers.java | 137 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/util/GLFixedArrayHandler.java (renamed from src/jogl/classes/com/sun/opengl/util/GLFixedArrayHandler.java) | 4 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/util/Gamma.java (renamed from src/jogl/classes/com/sun/opengl/util/Gamma.java) | 4 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/util/ImmModeSink.java (renamed from src/jogl/classes/com/sun/opengl/util/ImmModeSink.java) | 170 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/util/Locator.java (renamed from src/jogl/classes/com/sun/opengl/util/Locator.java) | 2 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/util/PMVMatrix.java (renamed from src/jogl/classes/com/sun/opengl/util/PMVMatrix.java) | 15 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/util/StreamUtil.java (renamed from src/jogl/classes/com/sun/opengl/util/StreamUtil.java) | 4 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/util/TGAWriter.java (renamed from src/jogl/classes/com/sun/opengl/util/TGAWriter.java) | 10 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/util/awt/ImageUtil.java (renamed from src/jogl/classes/com/sun/opengl/util/awt/ImageUtil.java) | 2 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/util/awt/Overlay.java (renamed from src/jogl/classes/com/sun/opengl/util/awt/Overlay.java) | 4 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/util/awt/Screenshot.java (renamed from src/jogl/classes/com/sun/opengl/util/awt/Screenshot.java) | 4 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/util/awt/TextRenderer.java (renamed from src/jogl/classes/com/sun/opengl/util/awt/TextRenderer.java) | 21 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/util/awt/TextureRenderer.java (renamed from src/jogl/classes/com/sun/opengl/util/awt/TextureRenderer.java) | 14 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/util/gl2/BitmapCharRec.java (renamed from src/jogl/classes/com/sun/opengl/util/gl2/BitmapCharRec.java) | 2 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/util/gl2/BitmapFontRec.java (renamed from src/jogl/classes/com/sun/opengl/util/gl2/BitmapFontRec.java) | 2 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/util/gl2/CoordRec.java (renamed from src/jogl/classes/com/sun/opengl/util/gl2/CoordRec.java) | 2 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/util/gl2/GLUT.java (renamed from src/jogl/classes/com/sun/opengl/util/gl2/GLUT.java) | 2 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTBitmap8x13.java (renamed from src/jogl/classes/com/sun/opengl/util/gl2/GLUTBitmap8x13.java) | 2 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTBitmap9x15.java (renamed from src/jogl/classes/com/sun/opengl/util/gl2/GLUTBitmap9x15.java) | 2 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTBitmapHelvetica10.java (renamed from src/jogl/classes/com/sun/opengl/util/gl2/GLUTBitmapHelvetica10.java) | 2 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTBitmapHelvetica12.java (renamed from src/jogl/classes/com/sun/opengl/util/gl2/GLUTBitmapHelvetica12.java) | 2 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTBitmapHelvetica18.java (renamed from src/jogl/classes/com/sun/opengl/util/gl2/GLUTBitmapHelvetica18.java) | 2 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTBitmapTimesRoman10.java (renamed from src/jogl/classes/com/sun/opengl/util/gl2/GLUTBitmapTimesRoman10.java) | 2 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTBitmapTimesRoman24.java (renamed from src/jogl/classes/com/sun/opengl/util/gl2/GLUTBitmapTimesRoman24.java) | 2 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTStrokeMonoRoman.java (renamed from src/jogl/classes/com/sun/opengl/util/gl2/GLUTStrokeMonoRoman.java) | 2 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTStrokeRoman.java (renamed from src/jogl/classes/com/sun/opengl/util/gl2/GLUTStrokeRoman.java) | 2 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/util/gl2/StrokeCharRec.java (renamed from src/jogl/classes/com/sun/opengl/util/gl2/StrokeCharRec.java) | 2 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/util/gl2/StrokeFontRec.java (renamed from src/jogl/classes/com/sun/opengl/util/gl2/StrokeFontRec.java) | 2 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/util/gl2/StrokeRec.java (renamed from src/jogl/classes/com/sun/opengl/util/gl2/StrokeRec.java) | 2 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/util/gl2/TileRenderer.java (renamed from src/jogl/classes/com/sun/opengl/util/gl2/TileRenderer.java) | 2 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/util/glsl/GLSLArrayHandler.java (renamed from src/jogl/classes/com/sun/opengl/util/glsl/GLSLArrayHandler.java) | 6 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderCode.java (renamed from src/jogl/classes/com/sun/opengl/util/glsl/ShaderCode.java) | 11 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderProgram.java (renamed from src/jogl/classes/com/sun/opengl/util/glsl/ShaderProgram.java) | 15 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderState.java (renamed from src/jogl/classes/com/sun/opengl/util/glsl/ShaderState.java) | 63 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderUtil.java (renamed from src/jogl/classes/com/sun/opengl/util/glsl/ShaderUtil.java) | 4 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/FixedFuncUtil.java (renamed from src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/FixedFuncUtil.java) | 14 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/impl/FixedFuncHook.java (renamed from src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/FixedFuncHook.java) | 36 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/impl/FixedFuncPipeline.java (renamed from src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/FixedFuncPipeline.java) | 28 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/impl/shaders/FixedFuncColor.fp (renamed from src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/FixedFuncColor.fp) | 0 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/impl/shaders/FixedFuncColor.vp (renamed from src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/FixedFuncColor.vp) | 0 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/impl/shaders/FixedFuncColorLight.vp (renamed from src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/FixedFuncColorLight.vp) | 0 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/impl/shaders/FixedFuncColorTexture.fp (renamed from src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/FixedFuncColorTexture.fp) | 0 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/impl/shaders/bin/nvidia/FixedFuncColor.bfp (renamed from src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/bin/nvidia/FixedFuncColor.bfp) | bin | 1108 -> 1108 bytes | |||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/impl/shaders/bin/nvidia/FixedFuncColor.bvp (renamed from src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/bin/nvidia/FixedFuncColor.bvp) | bin | 2344 -> 2344 bytes | |||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/impl/shaders/bin/nvidia/FixedFuncColorLight.bvp (renamed from src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/bin/nvidia/FixedFuncColorLight.bvp) | bin | 8787 -> 8787 bytes | |||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/impl/shaders/bin/nvidia/FixedFuncColorTexture.bfp (renamed from src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/bin/nvidia/FixedFuncColorTexture.bfp) | bin | 2392 -> 2392 bytes | |||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/impl/shaders/es_precision.glsl (renamed from src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/es_precision.glsl) | 0 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/impl/shaders/mgl_attribute.glsl (renamed from src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/mgl_attribute.glsl) | 0 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/impl/shaders/mgl_const.glsl (renamed from src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/mgl_const.glsl) | 0 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/impl/shaders/mgl_lightdef.glsl (renamed from src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/mgl_lightdef.glsl) | 0 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/impl/shaders/mgl_settexcoord.vp (renamed from src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/mgl_settexcoord.vp) | 0 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/impl/shaders/mgl_uniform.glsl (renamed from src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/mgl_uniform.glsl) | 0 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/impl/shaders/mgl_uniform_light.glsl (renamed from src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/mgl_uniform_light.glsl) | 0 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/impl/shaders/mgl_varying.glsl (renamed from src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/mgl_varying.glsl) | 0 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/impl/shaders/scripts/nvidia-apx/glslc-ff.bat (renamed from src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/scripts/nvidia-apx/glslc-ff.bat) | 2 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/impl/shaders/scripts/nvidia-apx/glslc.bat (renamed from src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/scripts/nvidia-apx/glslc.bat) | 2 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/util/glsl/sdk/CompileShader.java (renamed from src/jogl/classes/com/sun/opengl/util/glsl/sdk/CompileShader.java) | 27 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/util/glsl/sdk/CompileShaderNVidia.java (renamed from src/jogl/classes/com/sun/opengl/util/glsl/sdk/CompileShaderNVidia.java) | 6 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/util/packrect/BackingStoreManager.java (renamed from src/jogl/classes/com/sun/opengl/util/packrect/BackingStoreManager.java) | 2 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/util/packrect/Level.java (renamed from src/jogl/classes/com/sun/opengl/util/packrect/Level.java) | 2 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/util/packrect/LevelSet.java (renamed from src/jogl/classes/com/sun/opengl/util/packrect/LevelSet.java) | 2 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/util/packrect/Rect.java (renamed from src/jogl/classes/com/sun/opengl/util/packrect/Rect.java) | 2 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/util/packrect/RectVisitor.java (renamed from src/jogl/classes/com/sun/opengl/util/packrect/RectVisitor.java) | 2 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/util/packrect/RectanglePacker.java (renamed from src/jogl/classes/com/sun/opengl/util/packrect/RectanglePacker.java) | 2 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/util/packrect/package.html (renamed from src/jogl/classes/com/sun/opengl/util/packrect/package.html) | 0 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/util/texture/Texture.java (renamed from src/jogl/classes/com/sun/opengl/util/texture/Texture.java) | 36 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/util/texture/TextureCoords.java (renamed from src/jogl/classes/com/sun/opengl/util/texture/TextureCoords.java) | 2 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/util/texture/TextureData.java (renamed from src/jogl/classes/com/sun/opengl/util/texture/TextureData.java) | 58 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/util/texture/TextureIO.java.javame_cdc_fp (renamed from src/jogl/classes/com/sun/opengl/util/texture/TextureIO.java.javame_cdc_fp) | 107 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/util/texture/TextureIO.java.javase (renamed from src/jogl/classes/com/sun/opengl/util/texture/TextureIO.java.javase) | 107 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/util/texture/awt/AWTTextureData.java (renamed from src/jogl/classes/com/sun/opengl/util/texture/awt/AWTTextureData.java) | 41 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/util/texture/awt/AWTTextureIO.java (renamed from src/jogl/classes/com/sun/opengl/util/texture/awt/AWTTextureIO.java) | 30 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/util/texture/spi/DDSImage.java.javame_cdc_fp (renamed from src/jogl/classes/com/sun/opengl/util/texture/spi/DDSImage.java.javame_cdc_fp) | 8 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/util/texture/spi/DDSImage.java.javase (renamed from src/jogl/classes/com/sun/opengl/util/texture/spi/DDSImage.java.javase) | 8 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/util/texture/spi/LEDataInputStream.java (renamed from src/jogl/classes/com/sun/opengl/util/texture/spi/LEDataInputStream.java) | 2 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/util/texture/spi/LEDataOutputStream.java (renamed from src/jogl/classes/com/sun/opengl/util/texture/spi/LEDataOutputStream.java) | 2 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/util/texture/spi/NetPbmTextureWriter.java (renamed from src/jogl/classes/com/sun/opengl/util/texture/spi/NetPbmTextureWriter.java) | 8 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/util/texture/spi/SGIImage.java (renamed from src/jogl/classes/com/sun/opengl/util/texture/spi/SGIImage.java) | 4 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/util/texture/spi/TGAImage.java.javame_cdc_fp (renamed from src/jogl/classes/com/sun/opengl/util/texture/spi/TGAImage.java.javame_cdc_fp) | 16 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/util/texture/spi/TGAImage.java.javase (renamed from src/jogl/classes/com/sun/opengl/util/texture/spi/TGAImage.java.javase) | 16 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/util/texture/spi/TextureProvider.java (renamed from src/jogl/classes/com/sun/opengl/util/texture/spi/TextureProvider.java) | 17 | ||||
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/util/texture/spi/TextureWriter.java (renamed from src/jogl/classes/com/sun/opengl/util/texture/spi/TextureWriter.java) | 4 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/util/texture/spi/awt/IIOTextureProvider.java (renamed from src/jogl/classes/com/sun/opengl/util/texture/spi/awt/IIOTextureProvider.java) | 23 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/util/texture/spi/awt/IIOTextureWriter.java (renamed from src/jogl/classes/com/sun/opengl/util/texture/spi/awt/IIOTextureWriter.java) | 10 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/openmax/OMXEventListener.java (renamed from src/jogl/classes/com/sun/openmax/OMXEventListener.java) | 2 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/openmax/OMXInstance.java (renamed from src/jogl/classes/com/sun/openmax/OMXInstance.java) | 18 | ||||
-rwxr-xr-x | src/jogl/classes/com/sun/opengl/util/BufferUtil.java.javame_cdc_fp | 449 | ||||
-rwxr-xr-x | src/jogl/classes/com/sun/opengl/util/BufferUtil.java.javase | 499 | ||||
-rw-r--r-- | src/jogl/classes/javax/media/opengl/DefaultGLCapabilitiesChooser.java | 13 | ||||
-rw-r--r-- | src/jogl/classes/javax/media/opengl/GLArrayData.java | 10 | ||||
-rw-r--r-- | src/jogl/classes/javax/media/opengl/GLAutoDrawable.java | 2 | ||||
-rw-r--r-- | src/jogl/classes/javax/media/opengl/GLBase.java | 30 | ||||
-rw-r--r-- | src/jogl/classes/javax/media/opengl/GLContext.java | 257 | ||||
-rw-r--r-- | src/jogl/classes/javax/media/opengl/GLDrawableFactory.java | 82 | ||||
-rw-r--r-- | src/jogl/classes/javax/media/opengl/GLPipelineFactory.java | 2 | ||||
-rw-r--r-- | src/jogl/classes/javax/media/opengl/GLProfile.java | 512 | ||||
-rw-r--r-- | src/jogl/classes/javax/media/opengl/GLUniformData.java | 2 | ||||
-rwxr-xr-x | src/jogl/classes/javax/media/opengl/Threading.java | 2 | ||||
-rw-r--r-- | src/jogl/classes/javax/media/opengl/awt/GLCanvas.java | 2 | ||||
-rw-r--r-- | src/jogl/classes/javax/media/opengl/awt/GLJPanel.java | 18 | ||||
-rw-r--r-- | src/jogl/classes/javax/media/opengl/fixedfunc/GLMatrixFunc.java | 4 | ||||
-rwxr-xr-x | src/jogl/classes/javax/media/opengl/glu/GLUquadric.java | 2 | ||||
-rwxr-xr-x | src/jogl/classes/javax/media/opengl/glu/GLUtessellator.java | 2 | ||||
-rwxr-xr-x | src/jogl/classes/javax/media/opengl/glu/GLUtessellatorCallback.java | 4 | ||||
-rwxr-xr-x | src/jogl/classes/javax/media/opengl/glu/GLUtessellatorCallbackAdapter.java | 4 | ||||
-rwxr-xr-x | src/jogl/native/audio/Mixer.cpp | 26 | ||||
-rw-r--r-- | src/jogl/native/openmax/com_sun_openmax_OMXInstance.c | 36 | ||||
-rwxr-xr-x | src/junit/com/jogamp/test/junit/jogl/acore/TestGLProfile01CORE.java | 95 | ||||
-rwxr-xr-x | src/junit/com/jogamp/test/junit/jogl/awt/TestAWT01GLn.java | 106 | ||||
-rwxr-xr-x | src/junit/com/jogamp/test/junit/jogl/demos/es1/RedSquare.java | 170 | ||||
-rw-r--r-- | src/junit/com/jogamp/test/junit/jogl/demos/gl2/gears/Gears.java | 306 | ||||
-rwxr-xr-x | src/junit/com/jogamp/test/junit/jogl/drawable/TestDrawable01NEWT.java | 185 | ||||
-rwxr-xr-x[-rw-r--r--] | src/junit/com/jogamp/test/junit/jogl/offscreen/ReadBuffer2File.java (renamed from src/nativewindow/classes/com/sun/nativewindow/impl/jvm/JVMUtil.java) | 69 | ||||
-rwxr-xr-x | src/junit/com/jogamp/test/junit/jogl/offscreen/ReadBuffer2Screen.java | 192 | ||||
-rwxr-xr-x | src/junit/com/jogamp/test/junit/jogl/offscreen/ReadBufferBase.java | 95 | ||||
-rwxr-xr-x | src/junit/com/jogamp/test/junit/jogl/offscreen/ReadBufferUtil.java | 111 | ||||
-rwxr-xr-x | src/junit/com/jogamp/test/junit/jogl/offscreen/Surface2File.java | 82 | ||||
-rwxr-xr-x | src/junit/com/jogamp/test/junit/jogl/offscreen/TestOffscreen01NEWT.java | 389 | ||||
-rwxr-xr-x | src/junit/com/jogamp/test/junit/jogl/offscreen/WindowUtilNEWT.java | 113 | ||||
-rwxr-xr-x | src/junit/com/jogamp/test/junit/jogl/texture/TestTexture01AWT.java | 109 | ||||
-rwxr-xr-x | src/junit/com/jogamp/test/junit/jogl/util/texture/gl2/TextureGL2ListenerDraw1.java | 109 | ||||
-rwxr-xr-x | src/junit/com/jogamp/test/junit/newt/TestWindows01NEWT.java | 165 | ||||
-rw-r--r-- | src/junit/com/jogamp/test/junit/util/MiscUtils.java | 67 | ||||
-rw-r--r-- | src/nativewindow/classes/com/jogamp/nativewindow/impl/Debug.java (renamed from src/nativewindow/classes/com/sun/nativewindow/impl/Debug.java) | 2 | ||||
-rw-r--r-- | src/nativewindow/classes/com/jogamp/nativewindow/impl/GraphicsConfigurationFactoryImpl.java (renamed from src/nativewindow/classes/com/sun/nativewindow/impl/GraphicsConfigurationFactoryImpl.java) | 2 | ||||
-rw-r--r-- | src/nativewindow/classes/com/jogamp/nativewindow/impl/InternalBufferUtil.java (renamed from src/nativewindow/classes/com/sun/nativewindow/impl/InternalBufferUtil.java) | 4 | ||||
-rw-r--r-- | src/nativewindow/classes/com/jogamp/nativewindow/impl/LockingNativeWindowFactory.java (renamed from src/nativewindow/classes/com/sun/nativewindow/impl/LockingNativeWindowFactory.java) | 2 | ||||
-rw-r--r-- | src/nativewindow/classes/com/jogamp/nativewindow/impl/NWJNILibLoader.java | 50 | ||||
-rw-r--r-- | src/nativewindow/classes/com/jogamp/nativewindow/impl/NativeWindowFactoryImpl.java (renamed from src/nativewindow/classes/com/sun/nativewindow/impl/NativeWindowFactoryImpl.java) | 13 | ||||
-rw-r--r-- | src/nativewindow/classes/com/jogamp/nativewindow/impl/NullWindow.java (renamed from src/nativewindow/classes/com/sun/nativewindow/impl/NullWindow.java) | 2 | ||||
-rw-r--r-- | src/nativewindow/classes/com/jogamp/nativewindow/impl/jawt/JAWTJNILibLoader.java (renamed from src/nativewindow/classes/com/sun/nativewindow/impl/jawt/JAWTNativeLibLoader.java) | 6 | ||||
-rw-r--r-- | src/nativewindow/classes/com/jogamp/nativewindow/impl/jawt/JAWTUtil.java (renamed from src/nativewindow/classes/com/sun/nativewindow/impl/jawt/JAWTUtil.java) | 10 | ||||
-rw-r--r-- | src/nativewindow/classes/com/jogamp/nativewindow/impl/jawt/JAWTWindow.java (renamed from src/nativewindow/classes/com/sun/nativewindow/impl/jawt/JAWTWindow.java) | 6 | ||||
-rw-r--r-- | src/nativewindow/classes/com/jogamp/nativewindow/impl/jawt/JAWT_PlatformInfo.java (renamed from src/nativewindow/classes/com/sun/nativewindow/impl/jawt/JAWT_PlatformInfo.java) | 4 | ||||
-rw-r--r-- | src/nativewindow/classes/com/jogamp/nativewindow/impl/jawt/macosx/MacOSXJAWTWindow.java (renamed from src/nativewindow/classes/com/sun/nativewindow/impl/jawt/macosx/MacOSXJAWTWindow.java) | 6 | ||||
-rw-r--r-- | src/nativewindow/classes/com/jogamp/nativewindow/impl/jawt/windows/WindowsJAWTWindow.java (renamed from src/nativewindow/classes/com/sun/nativewindow/impl/jawt/windows/WindowsJAWTWindow.java) | 6 | ||||
-rw-r--r-- | src/nativewindow/classes/com/jogamp/nativewindow/impl/jawt/x11/X11JAWTWindow.java (renamed from src/nativewindow/classes/com/sun/nativewindow/impl/jawt/x11/X11JAWTWindow.java) | 8 | ||||
-rw-r--r-- | src/nativewindow/classes/com/jogamp/nativewindow/impl/jawt/x11/X11SunJDKReflection.java (renamed from src/nativewindow/classes/com/sun/nativewindow/impl/jawt/x11/X11SunJDKReflection.java) | 4 | ||||
-rw-r--r-- | src/nativewindow/classes/com/jogamp/nativewindow/impl/x11/X11GraphicsConfigurationFactory.java (renamed from src/nativewindow/classes/com/sun/nativewindow/impl/x11/X11GraphicsConfigurationFactory.java) | 10 | ||||
-rw-r--r-- | src/nativewindow/classes/com/jogamp/nativewindow/impl/x11/X11Util.java | 334 | ||||
-rw-r--r-- | src/nativewindow/classes/com/jogamp/nativewindow/impl/x11/awt/X11AWTNativeWindowFactory.java (renamed from src/nativewindow/classes/com/sun/nativewindow/impl/x11/awt/X11AWTNativeWindowFactory.java) | 10 | ||||
-rw-r--r-- | src/nativewindow/classes/com/sun/nativewindow/impl/NWReflection.java | 181 | ||||
-rw-r--r-- | src/nativewindow/classes/com/sun/nativewindow/impl/NativeLibLoaderBase.java | 202 | ||||
-rw-r--r-- | src/nativewindow/classes/com/sun/nativewindow/impl/x11/X11Util.java | 166 | ||||
-rw-r--r-- | src/nativewindow/classes/javax/media/nativewindow/GraphicsConfigurationFactory.java | 5 | ||||
-rw-r--r-- | src/nativewindow/classes/javax/media/nativewindow/NativeWindowFactory.java | 15 | ||||
-rw-r--r-- | src/nativewindow/classes/javax/media/nativewindow/awt/AWTGraphicsConfiguration.java | 2 | ||||
-rw-r--r-- | src/nativewindow/classes/javax/media/nativewindow/awt/AWTGraphicsDevice.java | 2 | ||||
-rw-r--r-- | src/nativewindow/classes/javax/media/nativewindow/awt/AWTGraphicsScreen.java | 2 | ||||
-rw-r--r-- | src/nativewindow/classes/javax/media/nativewindow/package.html | 2 | ||||
-rw-r--r-- | src/nativewindow/classes/javax/media/nativewindow/x11/X11GraphicsConfiguration.java | 2 | ||||
-rw-r--r-- | src/nativewindow/classes/javax/media/nativewindow/x11/X11GraphicsScreen.java | 37 | ||||
-rw-r--r-- | src/nativewindow/native/JAWT_DrawingSurfaceInfo.c | 2 | ||||
-rw-r--r-- | src/nativewindow/native/JVM_Tool.c | 51 | ||||
-rw-r--r-- | src/nativewindow/native/x11/Xmisc.c | 493 | ||||
-rwxr-xr-x | src/newt/classes/com/jogamp/newt/Display.java (renamed from src/newt/classes/com/sun/javafx/newt/Display.java) | 61 | ||||
-rw-r--r-- | src/newt/classes/com/jogamp/newt/Event.java (renamed from src/newt/classes/com/sun/javafx/newt/Event.java) | 2 | ||||
-rw-r--r-- | src/newt/classes/com/jogamp/newt/EventListener.java (renamed from src/newt/classes/com/sun/javafx/newt/EventListener.java) | 2 | ||||
-rw-r--r-- | src/newt/classes/com/jogamp/newt/InputEvent.java (renamed from src/newt/classes/com/sun/javafx/newt/InputEvent.java) | 2 | ||||
-rw-r--r-- | src/newt/classes/com/jogamp/newt/Insets.java (renamed from src/newt/classes/com/sun/javafx/newt/Insets.java) | 2 | ||||
-rw-r--r-- | src/newt/classes/com/jogamp/newt/KeyEvent.java (renamed from src/newt/classes/com/sun/javafx/newt/KeyEvent.java) | 2 | ||||
-rw-r--r-- | src/newt/classes/com/jogamp/newt/KeyListener.java (renamed from src/newt/classes/com/sun/javafx/newt/KeyListener.java) | 2 | ||||
-rw-r--r-- | src/newt/classes/com/jogamp/newt/MouseEvent.java (renamed from src/newt/classes/com/sun/javafx/newt/MouseEvent.java) | 2 | ||||
-rw-r--r-- | src/newt/classes/com/jogamp/newt/MouseListener.java (renamed from src/newt/classes/com/sun/javafx/newt/MouseListener.java) | 2 | ||||
-rwxr-xr-x | src/newt/classes/com/jogamp/newt/NewtFactory.java (renamed from src/newt/classes/com/sun/javafx/newt/NewtFactory.java) | 4 | ||||
-rw-r--r-- | src/newt/classes/com/jogamp/newt/OffscreenWindow.java (renamed from src/newt/classes/com/sun/javafx/newt/OffscreenWindow.java) | 2 | ||||
-rwxr-xr-x | src/newt/classes/com/jogamp/newt/PaintEvent.java (renamed from src/newt/classes/com/sun/javafx/newt/PaintEvent.java) | 2 | ||||
-rwxr-xr-x | src/newt/classes/com/jogamp/newt/PaintListener.java (renamed from src/newt/classes/com/sun/javafx/newt/PaintListener.java) | 2 | ||||
-rwxr-xr-x | src/newt/classes/com/jogamp/newt/Screen.java (renamed from src/newt/classes/com/sun/javafx/newt/Screen.java) | 14 | ||||
-rwxr-xr-x | src/newt/classes/com/jogamp/newt/Window.java (renamed from src/newt/classes/com/sun/javafx/newt/Window.java) | 242 | ||||
-rw-r--r-- | src/newt/classes/com/jogamp/newt/WindowEvent.java (renamed from src/newt/classes/com/sun/javafx/newt/WindowEvent.java) | 2 | ||||
-rw-r--r-- | src/newt/classes/com/jogamp/newt/WindowListener.java (renamed from src/newt/classes/com/sun/javafx/newt/WindowListener.java) | 2 | ||||
-rw-r--r-- | src/newt/classes/com/jogamp/newt/awt/AWTCanvas.java (renamed from src/newt/classes/com/sun/javafx/newt/awt/AWTCanvas.java) | 6 | ||||
-rw-r--r-- | src/newt/classes/com/jogamp/newt/awt/AWTDisplay.java (renamed from src/newt/classes/com/sun/javafx/newt/awt/AWTDisplay.java) | 50 | ||||
-rw-r--r-- | src/newt/classes/com/jogamp/newt/awt/AWTScreen.java (renamed from src/newt/classes/com/sun/javafx/newt/awt/AWTScreen.java) | 4 | ||||
-rw-r--r-- | src/newt/classes/com/jogamp/newt/awt/AWTWindow.java (renamed from src/newt/classes/com/sun/javafx/newt/awt/AWTWindow.java) | 56 | ||||
-rw-r--r-- | src/newt/classes/com/jogamp/newt/impl/Debug.java (renamed from src/newt/classes/com/sun/javafx/newt/impl/Debug.java) | 4 | ||||
-rw-r--r-- | src/newt/classes/com/jogamp/newt/impl/NEWTJNILibLoader.java (renamed from src/newt/classes/com/sun/javafx/newt/impl/NativeLibLoader.java) | 6 | ||||
-rw-r--r-- | src/newt/classes/com/jogamp/newt/intel/gdl/Display.java (renamed from src/newt/classes/com/sun/javafx/newt/intel/gdl/Display.java) | 8 | ||||
-rw-r--r-- | src/newt/classes/com/jogamp/newt/intel/gdl/Screen.java (renamed from src/newt/classes/com/sun/javafx/newt/intel/gdl/Screen.java) | 6 | ||||
-rw-r--r-- | src/newt/classes/com/jogamp/newt/intel/gdl/Window.java (renamed from src/newt/classes/com/sun/javafx/newt/intel/gdl/Window.java) | 4 | ||||
-rwxr-xr-x | src/newt/classes/com/jogamp/newt/macosx/MacDisplay.java (renamed from src/newt/classes/com/sun/javafx/newt/macosx/MacDisplay.java) | 10 | ||||
-rwxr-xr-x | src/newt/classes/com/jogamp/newt/macosx/MacScreen.java (renamed from src/newt/classes/com/sun/javafx/newt/macosx/MacScreen.java) | 4 | ||||
-rwxr-xr-x | src/newt/classes/com/jogamp/newt/macosx/MacWindow.java (renamed from src/newt/classes/com/sun/javafx/newt/macosx/MacWindow.java) | 48 | ||||
-rw-r--r-- | src/newt/classes/com/jogamp/newt/opengl/GLWindow.java (renamed from src/newt/classes/com/sun/javafx/newt/opengl/GLWindow.java) | 22 | ||||
-rw-r--r-- | src/newt/classes/com/jogamp/newt/opengl/broadcom/egl/Display.java (renamed from src/newt/classes/com/sun/javafx/newt/opengl/broadcom/egl/Display.java) | 10 | ||||
-rwxr-xr-x | src/newt/classes/com/jogamp/newt/opengl/broadcom/egl/Screen.java (renamed from src/newt/classes/com/sun/javafx/newt/opengl/broadcom/egl/Screen.java) | 5 | ||||
-rwxr-xr-x | src/newt/classes/com/jogamp/newt/opengl/broadcom/egl/Window.java (renamed from src/newt/classes/com/sun/javafx/newt/opengl/broadcom/egl/Window.java) | 8 | ||||
-rwxr-xr-x | src/newt/classes/com/jogamp/newt/opengl/kd/KDDisplay.java (renamed from src/newt/classes/com/sun/javafx/newt/opengl/kd/KDDisplay.java) | 10 | ||||
-rwxr-xr-x | src/newt/classes/com/jogamp/newt/opengl/kd/KDScreen.java (renamed from src/newt/classes/com/sun/javafx/newt/opengl/kd/KDScreen.java) | 4 | ||||
-rwxr-xr-x | src/newt/classes/com/jogamp/newt/opengl/kd/KDWindow.java (renamed from src/newt/classes/com/sun/javafx/newt/opengl/kd/KDWindow.java) | 8 | ||||
-rw-r--r-- | src/newt/classes/com/jogamp/newt/util/EDTUtil.java (renamed from src/newt/classes/com/sun/javafx/newt/util/EventDispatchThread.java) | 98 | ||||
-rw-r--r-- | src/newt/classes/com/jogamp/newt/util/MainThread.java (renamed from src/newt/classes/com/sun/javafx/newt/util/MainThread.java) | 18 | ||||
-rwxr-xr-x | src/newt/classes/com/jogamp/newt/windows/WindowsDisplay.java (renamed from src/newt/classes/com/sun/javafx/newt/windows/WindowsDisplay.java) | 8 | ||||
-rwxr-xr-x | src/newt/classes/com/jogamp/newt/windows/WindowsScreen.java (renamed from src/newt/classes/com/sun/javafx/newt/windows/WindowsScreen.java) | 5 | ||||
-rwxr-xr-x | src/newt/classes/com/jogamp/newt/windows/WindowsWindow.java (renamed from src/newt/classes/com/sun/javafx/newt/windows/WindowsWindow.java) | 4 | ||||
-rwxr-xr-x | src/newt/classes/com/jogamp/newt/x11/X11Display.java (renamed from src/newt/classes/com/sun/javafx/newt/x11/X11Display.java) | 16 | ||||
-rwxr-xr-x | src/newt/classes/com/jogamp/newt/x11/X11Screen.java (renamed from src/newt/classes/com/sun/javafx/newt/x11/X11Screen.java) | 6 | ||||
-rwxr-xr-x | src/newt/classes/com/jogamp/newt/x11/X11Window.java (renamed from src/newt/classes/com/sun/javafx/newt/x11/X11Window.java) | 5 | ||||
-rwxr-xr-x | src/newt/native/BroadcomEGL.c | 16 | ||||
-rw-r--r-- | src/newt/native/IntelGDL.c | 24 | ||||
-rwxr-xr-x | src/newt/native/KDWindow.c | 20 | ||||
-rw-r--r-- | src/newt/native/MacWindow.m | 62 | ||||
-rw-r--r-- | src/newt/native/NewtMacWindow.h | 2 | ||||
-rwxr-xr-x | src/newt/native/NewtMacWindow.m | 2 | ||||
-rwxr-xr-x | src/newt/native/WindowsWindow.c | 74 | ||||
-rwxr-xr-x | src/newt/native/X11Window.c | 194 | ||||
-rwxr-xr-x | test/Issue326Test1.java | 6 | ||||
-rwxr-xr-x | test/Issue326Test2.java | 2 | ||||
-rwxr-xr-x | test/Issue344Base.java | 4 | ||||
-rw-r--r-- | tools/jackpotc/.gitignore | 1 | ||||
-rwxr-xr-x | tools/jackpotc/bttf | 8 | ||||
-rwxr-xr-x | tools/jackpotc/jackpotc | 2 | ||||
-rw-r--r-- | tools/jackpotc/jogl1Tojogl2.hint | 22 | ||||
-rwxr-xr-x | tools/jackpotc/setup | 5 | ||||
-rw-r--r-- | tools/jackpotc/test/oldgears/.gitignore | 3 | ||||
-rw-r--r-- | tools/jackpotc/test/oldgears/build.xml | 74 | ||||
-rw-r--r-- | tools/jackpotc/test/oldgears/manifest.mf | 3 | ||||
-rw-r--r-- | tools/jackpotc/test/oldgears/nbproject/build-impl.xml | 883 | ||||
-rw-r--r-- | tools/jackpotc/test/oldgears/nbproject/genfiles.properties | 8 | ||||
-rw-r--r-- | tools/jackpotc/test/oldgears/nbproject/project.properties | 68 | ||||
-rw-r--r-- | tools/jackpotc/test/oldgears/nbproject/project.xml | 15 | ||||
-rw-r--r-- | tools/jackpotc/test/oldgears/src/jogl111/gears/Gears.java | 307 |
573 files changed, 14341 insertions, 7986 deletions
diff --git a/.gitignore b/.gitignore index 378eac25d..6e3af642b 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,6 @@ build +javadoc_public +build-temp +make/temp* +.idea/workspace.xml +**~
\ No newline at end of file diff --git a/CHANGELOG.txt b/CHANGELOG.txt index c976f68db..39112dbf0 100755 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -103,3 +103,6 @@ Changes between JOGL 1.0.0 and 1.1.0: - Worked around breakage of JOGL with 5.0u10; see Sun bug IDs 6504460 and 6333613. + +Changes between JOGL 1.1.1 and 2.0: + - lots of changes
\ No newline at end of file diff --git a/doc/bouml/html-svg/classdiagrams.html b/doc/bouml/html-svg/classdiagrams.html new file mode 100644 index 000000000..4f4efc693 --- /dev/null +++ b/doc/bouml/html-svg/classdiagrams.html @@ -0,0 +1,22 @@ +<!-- Documentation produced by the Html generator of Bouml (http://bouml.free.fr) --> +<?xml version="1.0" encoding="UTF-8"?> +<!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" xmlns:svg="http://www.w3.org/2000/svg"> + +<head> +<title>Class Diagram Index</title> +<link rel="stylesheet" href="style.css" type="text/css" /> +</head> + +<body bgcolor="#ffffff"> + +<div class = "title">Class Diagram Index</div> +<p></p> + +<!-- ============================================================= --> + +<table> +<tr bgcolor=#f0f0f0><td><a href="index.html#refclass diagram128069" target = "projectFrame"><b>OpenGL Interfaces</b></a></td><td></td><td></td></tr> +</table> +</body> +</html> diff --git a/doc/bouml/html-svg/classes.html b/doc/bouml/html-svg/classes.html new file mode 100644 index 000000000..dd1a230ed --- /dev/null +++ b/doc/bouml/html-svg/classes.html @@ -0,0 +1,44 @@ +<!-- Documentation produced by the Html generator of Bouml (http://bouml.free.fr) --> +<?xml version="1.0" encoding="UTF-8"?> +<!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" xmlns:svg="http://www.w3.org/2000/svg"> + +<head> +<title>Classes Index</title> +<link rel="stylesheet" href="style.css" type="text/css" /> +</head> + +<body bgcolor="#ffffff"> + +<div class = "title">Classes Index</div> +<p></p> + +<!-- ============================================================= --> + +<table> +<tr bgcolor=#f0f0f0><td><a href="index.html#refclass131013" target = "projectFrame"><b>AbstractGraphicsConfiguration</b></a></td><td></td><td></td></tr> +<tr bgcolor=#f0f0f0><td><a href="index.html#refclass131269" target = "projectFrame"><b>Capabilities</b></a></td><td></td><td></td></tr> +<tr bgcolor=#f0f0f0><td><a href="index.html#refclass128069" target = "projectFrame"><b>GL</b></a></td><td>interface</td><td></td></tr> +<tr bgcolor=#f0f0f0><td><a href="index.html#refclass128453" target = "projectFrame"><b>GL2</b></a></td><td>interface</td><td></td></tr> +<tr bgcolor=#f0f0f0><td><a href="index.html#refclass128197" target = "projectFrame"><b>GL2ES1</b></a></td><td>interface</td><td></td></tr> +<tr bgcolor=#f0f0f0><td><a href="index.html#refclass128386" target = "projectFrame"><b>GL2ES12</b></a></td><td>entity</td><td></td></tr> +<tr bgcolor=#f0f0f0><td><a href="index.html#refclass128581" target = "projectFrame"><b>GL2ES2</b></a></td><td>interface</td><td></td></tr> +<tr bgcolor=#f0f0f0><td><a href="index.html#refclass128709" target = "projectFrame"><b>GL2GL3</b></a></td><td>interface</td><td></td></tr> +<tr bgcolor=#f0f0f0><td><a href="index.html#refclass128837" target = "projectFrame"><b>GL3</b></a></td><td>interface</td><td></td></tr> +<tr bgcolor=#f0f0f0><td><a href="index.html#refclass128002" target = "projectFrame"><b>GL3bc</b></a></td><td>interface</td><td></td></tr> +<tr bgcolor=#f0f0f0><td><a href="index.html#refclass128130" target = "projectFrame"><b>GL4</b></a></td><td>interface</td><td></td></tr> +<tr bgcolor=#f0f0f0><td><a href="index.html#refclass128258" target = "projectFrame"><b>GL4bc</b></a></td><td>interface</td><td></td></tr> +<tr bgcolor=#f0f0f0><td><a href="index.html#refclass130501" target = "projectFrame"><b>GL4bcImpl</b></a></td><td>entity</td><td></td></tr> +<tr bgcolor=#f0f0f0><td><a href="index.html#refclass132549" target = "projectFrame"><b>GLBase</b></a></td><td>interface</td><td></td></tr> +<tr bgcolor=#f0f0f0><td><a href="index.html#refclass131141" target = "projectFrame"><b>GLCapabilities</b></a></td><td></td><td></td></tr> +<tr bgcolor=#f0f0f0><td><a href="index.html#refclass130117" target = "projectFrame"><b>GLContext</b></a></td><td></td><td></td></tr> +<tr bgcolor=#f0f0f0><td><a href="index.html#refclass130245" target = "projectFrame"><b>GLDrawable</b></a></td><td></td><td></td></tr> +<tr bgcolor=#f0f0f0><td><a href="index.html#refclass128325" target = "projectFrame"><b>GLES1</b></a></td><td>interface</td><td></td></tr> +<tr bgcolor=#f0f0f0><td><a href="index.html#refclass130757" target = "projectFrame"><b>GLES1Impl</b></a></td><td>entity</td><td></td></tr> +<tr bgcolor=#f0f0f0><td><a href="index.html#refclass128965" target = "projectFrame"><b>GLES2</b></a></td><td>interface</td><td></td></tr> +<tr bgcolor=#f0f0f0><td><a href="index.html#refclass130629" target = "projectFrame"><b>GLES2Impl</b></a></td><td>entity</td><td></td></tr> +<tr bgcolor=#f0f0f0><td><a href="index.html#refclass131397" target = "projectFrame"><b>GLProfile</b></a></td><td></td><td></td></tr> +<tr bgcolor=#f0f0f0><td><a href="index.html#refclass130885" target = "projectFrame"><b>NativeWindow</b></a></td><td>interface</td><td></td></tr> +</table> +</body> +</html> diff --git a/doc/bouml/html-svg/classes_list.html b/doc/bouml/html-svg/classes_list.html new file mode 100644 index 000000000..69e77a5ad --- /dev/null +++ b/doc/bouml/html-svg/classes_list.html @@ -0,0 +1,47 @@ +<!-- Documentation produced by the Html generator of Bouml (http://bouml.free.fr) --> +<?xml version="1.0" encoding="UTF-8"?> +<!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" xmlns:svg="http://www.w3.org/2000/svg"> + +<head> +<title>Classes</title> +<link rel="stylesheet" href="style.css" type="text/css" /> +</head> + +<body bgcolor="#ffffff"> + +<div class = "title">Classes</div> +<p></p> + +<!-- ============================================================= --> + +<table border="0" width="100%"> +<tr> +<td nowrap><a href="index.html#refclass131013" target = "projectFrame"><b>AbstractGraphicsConfiguration</b></a><br /> +<a href="index.html#refclass131269" target = "projectFrame"><b>Capabilities</b></a><br /> +<a href="index.html#refclass128069" target = "projectFrame"><b>GL</b></a><br /> +<a href="index.html#refclass128453" target = "projectFrame"><b>GL2</b></a><br /> +<a href="index.html#refclass128197" target = "projectFrame"><b>GL2ES1</b></a><br /> +<a href="index.html#refclass128386" target = "projectFrame"><b>GL2ES12</b></a><br /> +<a href="index.html#refclass128581" target = "projectFrame"><b>GL2ES2</b></a><br /> +<a href="index.html#refclass128709" target = "projectFrame"><b>GL2GL3</b></a><br /> +<a href="index.html#refclass128837" target = "projectFrame"><b>GL3</b></a><br /> +<a href="index.html#refclass128002" target = "projectFrame"><b>GL3bc</b></a><br /> +<a href="index.html#refclass128130" target = "projectFrame"><b>GL4</b></a><br /> +<a href="index.html#refclass128258" target = "projectFrame"><b>GL4bc</b></a><br /> +<a href="index.html#refclass130501" target = "projectFrame"><b>GL4bcImpl</b></a><br /> +<a href="index.html#refclass132549" target = "projectFrame"><b>GLBase</b></a><br /> +<a href="index.html#refclass131141" target = "projectFrame"><b>GLCapabilities</b></a><br /> +<a href="index.html#refclass130117" target = "projectFrame"><b>GLContext</b></a><br /> +<a href="index.html#refclass130245" target = "projectFrame"><b>GLDrawable</b></a><br /> +<a href="index.html#refclass128325" target = "projectFrame"><b>GLES1</b></a><br /> +<a href="index.html#refclass130757" target = "projectFrame"><b>GLES1Impl</b></a><br /> +<a href="index.html#refclass128965" target = "projectFrame"><b>GLES2</b></a><br /> +<a href="index.html#refclass130629" target = "projectFrame"><b>GLES2Impl</b></a><br /> +<a href="index.html#refclass131397" target = "projectFrame"><b>GLProfile</b></a><br /> +<a href="index.html#refclass130885" target = "projectFrame"><b>NativeWindow</b></a><br /> +</td> +</tr> +</table> +</body> +</html> diff --git a/doc/bouml/html-svg/fig128069.svg b/doc/bouml/html-svg/fig128069.svg new file mode 100644 index 000000000..77e4a0941 --- /dev/null +++ b/doc/bouml/html-svg/fig128069.svg @@ -0,0 +1,437 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Bouml (http://bouml.free.fr/) --> +<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> +<svg width="1003" height="1180" version="1.1" xmlns="http://www.w3.org/2000/svg"> +<g> + <rect fill="#ededed" stroke="black" stroke-width="1" stroke-opacity="1" x="2" y="195" width="237" height="972" /> + <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" text-anchor="middle" x="48" y="212">Fixed Function</text> + <line stroke="black" stroke-opacity="1" x1="2" y1="219" x2="93" y2="219" /> + <line stroke="black" stroke-opacity="1" x1="93" y1="219" x2="105" y2="207" /> + <line stroke="black" stroke-opacity="1" x1="105" y1="207" x2="105" y2="195" /> +</g> +<g> + <line stroke="black" stroke-dasharray="20,4" stroke-opacity="1" x1="2" y1="393" x2="239" y2="393" /> +</g> +<g> + <line stroke="black" stroke-dasharray="20,4" stroke-opacity="1" x1="2" y1="571" x2="239" y2="571" /> +</g> +<g> + <line stroke="black" stroke-dasharray="20,4" stroke-opacity="1" x1="2" y1="306" x2="239" y2="306" /> +</g> +<g> + <rect fill="#c0ffff" stroke="black" stroke-width="1" stroke-opacity="1" x="238" y="195" width="505" height="973" /> + <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" text-anchor="middle" x="306" y="212">Programmable Shader</text> + <line stroke="black" stroke-opacity="1" x1="238" y1="219" x2="374" y2="219" /> + <line stroke="black" stroke-opacity="1" x1="374" y1="219" x2="386" y2="207" /> + <line stroke="black" stroke-opacity="1" x1="386" y1="207" x2="386" y2="195" /> +</g> +<g> + <line stroke="black" stroke-dasharray="20,4" stroke-opacity="1" x1="238" y1="394" x2="743" y2="394" /> +</g> +<g> + <line stroke="black" stroke-dasharray="20,4" stroke-opacity="1" x1="238" y1="571" x2="743" y2="571" /> +</g> +<g> + <line stroke="black" stroke-dasharray="20,4" stroke-opacity="1" x1="238" y1="306" x2="743" y2="306" /> +</g> +<g> + <line stroke="black" stroke-opacity="1" x1="114" y1="225" x2="153" y2="178" /> + <line stroke="black" stroke-opacity="1" x1="157" y1="174" x2="148" y2="174" /> + <line stroke="black" stroke-opacity="1" x1="157" y1="174" x2="157" y2="182" /> + <line stroke="black" stroke-opacity="1" x1="148" y1="174" x2="157" y2="182" /> +</g> +<g> + <line stroke="black" stroke-opacity="1" x1="284" y1="225" x2="230" y2="177" /> + <line stroke="black" stroke-opacity="1" x1="226" y1="174" x2="226" y2="182" /> + <line stroke="black" stroke-opacity="1" x1="226" y1="174" x2="234" y2="173" /> + <line stroke="black" stroke-opacity="1" x1="226" y1="182" x2="234" y2="173" /> +</g> +<g> + <line stroke="black" stroke-opacity="1" x1="87" y1="400" x2="87" y2="294" /> + <line stroke="black" stroke-opacity="1" x1="87" y1="288" x2="81" y2="294" /> + <line stroke="black" stroke-opacity="1" x1="87" y1="288" x2="93" y2="294" /> + <line stroke="black" stroke-opacity="1" x1="81" y1="294" x2="93" y2="294" /> +</g> +<g> + <line stroke="black" stroke-opacity="1" x1="322" y1="400" x2="322" y2="294" /> + <line stroke="black" stroke-opacity="1" x1="322" y1="288" x2="316" y2="294" /> + <line stroke="black" stroke-opacity="1" x1="322" y1="288" x2="328" y2="294" /> + <line stroke="black" stroke-opacity="1" x1="316" y1="294" x2="328" y2="294" /> +</g> +<g> + <line stroke="black" stroke-opacity="1" x1="538" y1="683" x2="538" y2="384" /> + <line stroke="black" stroke-opacity="1" x1="538" y1="378" x2="532" y2="384" /> + <line stroke="black" stroke-opacity="1" x1="538" y1="378" x2="544" y2="384" /> + <line stroke="black" stroke-opacity="1" x1="532" y1="384" x2="544" y2="384" /> +</g> +<g> + <line stroke="black" stroke-opacity="1" x1="273" y1="614" x2="500" y2="382" /> + <line stroke="black" stroke-opacity="1" x1="505" y1="378" x2="496" y2="378" /> + <line stroke="black" stroke-opacity="1" x1="505" y1="378" x2="505" y2="386" /> + <line stroke="black" stroke-opacity="1" x1="496" y1="378" x2="505" y2="386" /> +</g> +<g> + <line stroke="black" stroke-opacity="1" x1="492" y1="326" x2="373" y2="277" /> + <line stroke="black" stroke-opacity="1" x1="368" y1="275" x2="371" y2="282" /> + <line stroke="black" stroke-opacity="1" x1="368" y1="275" x2="375" y2="271" /> + <line stroke="black" stroke-opacity="1" x1="371" y1="282" x2="375" y2="271" /> +</g> +<g> + <line stroke="black" stroke-opacity="1" x1="231" y1="614" x2="101" y2="293" /> + <line stroke="black" stroke-opacity="1" x1="99" y1="288" x2="95" y2="295" /> + <line stroke="black" stroke-opacity="1" x1="99" y1="288" x2="106" y2="291" /> + <line stroke="black" stroke-opacity="1" x1="95" y1="295" x2="106" y2="291" /> +</g> +<g> + <line stroke="black" stroke-opacity="1" x1="679" y1="115" x2="601" y2="62" /> +</g> +<g> + <line stroke-dasharray="4,4" stroke="black" stroke-opacity="1" x1="86" y1="483" x2="86" y2="469" /> + <line stroke="black" stroke-opacity="1" x1="86" y1="463" x2="80" y2="469" /> + <line stroke="black" stroke-opacity="1" x1="86" y1="463" x2="92" y2="469" /> + <line stroke="black" stroke-opacity="1" x1="80" y1="469" x2="92" y2="469" /> +</g> +<g> + <line stroke-dasharray="4,4" stroke="black" stroke-opacity="1" x1="323" y1="490" x2="323" y2="469" /> + <line stroke="black" stroke-opacity="1" x1="323" y1="463" x2="317" y2="469" /> + <line stroke="black" stroke-opacity="1" x1="323" y1="463" x2="329" y2="469" /> + <line stroke="black" stroke-opacity="1" x1="317" y1="469" x2="329" y2="469" /> +</g> +<g> + <line stroke-dasharray="4,4" stroke="black" stroke-opacity="1" x1="408" y1="1047" x2="521" y2="751" /> + <line stroke="black" stroke-opacity="1" x1="524" y1="746" x2="516" y2="749" /> + <line stroke="black" stroke-opacity="1" x1="524" y1="746" x2="527" y2="753" /> + <line stroke="black" stroke-opacity="1" x1="516" y1="749" x2="527" y2="753" /> +</g> +<g> + <line stroke="black" stroke-opacity="1" x1="848" y1="466" x2="848" y2="445" /> + <line stroke="black" stroke-opacity="1" x1="848" y1="439" x2="842" y2="445" /> + <line stroke="black" stroke-opacity="1" x1="848" y1="439" x2="854" y2="445" /> + <line stroke="black" stroke-opacity="1" x1="842" y1="445" x2="854" y2="445" /> +</g> +<g> + <line stroke="black" stroke-opacity="1" x1="815" y1="344" x2="815" y2="398" /> +</g> +<g> + <line stroke="black" stroke-opacity="1" x1="850" y1="303" x2="850" y2="266" /> +</g> +<g> + <line stroke="black" stroke-opacity="1" x1="806" y1="203" x2="739" y2="156" /> +</g> +<g> + <line stroke="black" stroke-opacity="1" x1="848" y1="547" x2="848" y2="507" /> +</g> +<g> + <line stroke="black" stroke-opacity="1" x1="882" y1="398" x2="882" y2="344" /> +</g> +<g> + <line stroke="black" stroke-opacity="1" x1="848" y1="547" x2="848" y2="507" /> +</g> +<g> + <line stroke="black" stroke-opacity="1" x1="188" y1="111" x2="188" y2="80" /> + <line stroke="black" stroke-opacity="1" x1="188" y1="74" x2="182" y2="80" /> + <line stroke="black" stroke-opacity="1" x1="188" y1="74" x2="194" y2="80" /> + <line stroke="black" stroke-opacity="1" x1="182" y1="80" x2="194" y2="80" /> +</g> +<g> + <line stroke="black" stroke-opacity="1" x1="235" y1="42" x2="533" y2="42" /> +</g> +<g> + <rect fill="#808080" stroke="none" stroke-opacity="1" x="285" y="765" width="3" height="57" /> + <rect fill="#808080" stroke="none" stroke-opacity="1" x="201" y="819" width="87" height="3" /> + <rect fill="#ffffc0" stroke="black" stroke-width="1" stroke-opacity="1" x="197" y="761" width="88" height="58" /> + <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" text-anchor="middle" x="241" y="773"><<interface>></text> + <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" font-weight="bold" text-anchor="middle" x="241" y="794">GL3bc</text> + <line stroke="black" stroke-opacity="1" x1="197" y1="803" x2="285" y2="803" /> + <line stroke="black" stroke-opacity="1" x1="197" y1="811" x2="285" y2="811" /> +</g> +<g> + <rect fill="#808080" stroke="none" stroke-opacity="1" x="130" y="230" width="3" height="57" /> + <rect fill="#808080" stroke="none" stroke-opacity="1" x="46" y="284" width="87" height="3" /> + <rect fill="#ffffc0" stroke="black" stroke-width="1" stroke-opacity="1" x="42" y="226" width="88" height="58" /> + <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" text-anchor="middle" x="86" y="238"><<interface>></text> + <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" font-weight="bold" text-anchor="middle" x="86" y="259">GL2ES1</text> + <line stroke="black" stroke-opacity="1" x1="42" y1="268" x2="130" y2="268" /> + <line stroke="black" stroke-opacity="1" x1="42" y1="276" x2="130" y2="276" /> +</g> +<g> + <rect fill="#808080" stroke="none" stroke-opacity="1" x="230" y="116" width="3" height="57" /> + <rect fill="#808080" stroke="none" stroke-opacity="1" x="146" y="170" width="87" height="3" /> + <rect fill="#ffffc0" stroke="black" stroke-width="1" stroke-opacity="1" x="142" y="112" width="88" height="58" /> + <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" text-anchor="middle" x="186" y="124"><<interface>></text> + <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" font-weight="bold" text-anchor="middle" x="186" y="145">GL</text> + <line stroke="black" stroke-opacity="1" x1="142" y1="154" x2="230" y2="154" /> + <line stroke="black" stroke-opacity="1" x1="142" y1="162" x2="230" y2="162" /> +</g> +<g> + <rect fill="#808080" stroke="none" stroke-opacity="1" x="129" y="405" width="3" height="57" /> + <rect fill="#808080" stroke="none" stroke-opacity="1" x="45" y="459" width="87" height="3" /> + <rect fill="#ffffc0" stroke="black" stroke-width="1" stroke-opacity="1" x="41" y="401" width="88" height="58" /> + <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" text-anchor="middle" x="85" y="413"><<interface>></text> + <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" font-weight="bold" text-anchor="middle" x="85" y="434">GLES1</text> + <line stroke="black" stroke-opacity="1" x1="41" y1="443" x2="129" y2="443" /> + <line stroke="black" stroke-opacity="1" x1="41" y1="451" x2="129" y2="451" /> +</g> +<g> + <rect fill="#808080" stroke="none" stroke-opacity="1" x="287" y="619" width="3" height="57" /> + <rect fill="#808080" stroke="none" stroke-opacity="1" x="203" y="673" width="87" height="3" /> + <rect fill="#ffffc0" stroke="black" stroke-width="1" stroke-opacity="1" x="199" y="615" width="88" height="58" /> + <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" text-anchor="middle" x="243" y="627"><<interface>></text> + <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" font-weight="bold" text-anchor="middle" x="243" y="648">GL2</text> + <line stroke="black" stroke-opacity="1" x1="199" y1="657" x2="287" y2="657" /> + <line stroke="black" stroke-opacity="1" x1="199" y1="665" x2="287" y2="665" /> +</g> +<g> + <line stroke="black" stroke-opacity="1" x1="389" y1="1068" x2="409" y2="1068" /> + <ellipse fill="#ffffc0" stroke="black" stroke-width="1" stroke-opacity="1" cx="399" cy="1058" rx="10" ry="10" /> + <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" font-weight="bold" text-anchor="middle" x="399" y="1080">GL4bcImpl</text> + <line stroke="black" stroke-opacity="1" x1="361" y1="1089" x2="437" y2="1089" /> + <line stroke="black" stroke-opacity="1" x1="361" y1="1097" x2="437" y2="1097" /> +</g> +<g> + <line stroke="black" stroke-opacity="1" x1="313" y1="511" x2="333" y2="511" /> + <ellipse fill="#ffffc0" stroke="black" stroke-width="1" stroke-opacity="1" cx="323" cy="501" rx="10" ry="10" /> + <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" font-weight="bold" text-anchor="middle" x="323" y="523">GLES2Impl</text> + <line stroke="black" stroke-opacity="1" x1="284" y1="532" x2="362" y2="532" /> + <line stroke="black" stroke-opacity="1" x1="284" y1="540" x2="362" y2="540" /> +</g> + <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" x="20" y="1090">Private implementation (detail)</text> + <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" x="606" y="261">Desktop/Mobile</text> + <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" x="606" y="279">Common Interfaces</text> +<g> + <rect fill="#808080" stroke="none" stroke-opacity="1" x="896" y="208" width="3" height="57" /> + <rect fill="#808080" stroke="none" stroke-opacity="1" x="804" y="262" width="95" height="3" /> + <rect fill="#ffffc0" stroke="black" stroke-width="1" stroke-opacity="1" x="800" y="204" width="96" height="58" /> + <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" text-anchor="middle" x="848" y="216"><<interface>></text> + <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" font-weight="bold" text-anchor="middle" x="848" y="237">NativeWindow</text> + <line stroke="black" stroke-opacity="1" x1="800" y1="246" x2="896" y2="246" /> + <line stroke="black" stroke-opacity="1" x1="800" y1="254" x2="896" y2="254" /> +</g> + <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" x="784" y="33">Lifecycle: From the lower right to</text> + <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" x="784" y="51">the top, left step where the</text> + <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" x="784" y="69">GLContext is created with a suitable</text> + <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" x="784" y="87">GL implementation matching the</text> + <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" x="784" y="105">GLProfile.</text> +<g> + <rect fill="#808080" stroke="none" stroke-opacity="1" x="948" y="308" width="3" height="35" /> + <rect fill="#808080" stroke="none" stroke-opacity="1" x="752" y="340" width="199" height="3" /> + <rect fill="#ffffc0" stroke="black" stroke-width="1" stroke-opacity="1" x="748" y="304" width="200" height="36" /> + <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" font-weight="bold" font-style="italic" text-anchor="middle" x="848" y="316">AbstractGraphicsConfiguration</text> + <line stroke="black" stroke-opacity="1" x1="748" y1="325" x2="948" y2="325" /> + <line stroke="black" stroke-opacity="1" x1="748" y1="333" x2="948" y2="333" /> +</g> +<g> + <rect fill="#808080" stroke="none" stroke-opacity="1" x="895" y="471" width="3" height="35" /> + <rect fill="#808080" stroke="none" stroke-opacity="1" x="801" y="503" width="97" height="3" /> + <rect fill="#ffffc0" stroke="black" stroke-width="1" stroke-opacity="1" x="797" y="467" width="98" height="36" /> + <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" font-weight="bold" text-anchor="middle" x="846" y="479">GLCapabilities</text> + <line stroke="black" stroke-opacity="1" x1="797" y1="488" x2="895" y2="488" /> + <line stroke="black" stroke-opacity="1" x1="797" y1="496" x2="895" y2="496" /> +</g> +<g> + <rect fill="#808080" stroke="none" stroke-opacity="1" x="880" y="552" width="3" height="35" /> + <rect fill="#808080" stroke="none" stroke-opacity="1" x="818" y="584" width="65" height="3" /> + <rect fill="#ffffc0" stroke="black" stroke-width="1" stroke-opacity="1" x="814" y="548" width="66" height="36" /> + <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" font-weight="bold" text-anchor="middle" x="847" y="560">GLProfile</text> + <line stroke="black" stroke-opacity="1" x1="814" y1="569" x2="880" y2="569" /> + <line stroke="black" stroke-opacity="1" x1="814" y1="577" x2="880" y2="577" /> +</g> +<g> + <rect fill="#808080" stroke="none" stroke-opacity="1" x="231" y="16" width="3" height="57" /> + <rect fill="#808080" stroke="none" stroke-opacity="1" x="147" y="70" width="87" height="3" /> + <rect fill="#ffffc0" stroke="black" stroke-width="1" stroke-opacity="1" x="143" y="12" width="88" height="58" /> + <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" text-anchor="middle" x="187" y="24"><<interface>></text> + <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" font-weight="bold" text-anchor="middle" x="187" y="45">GLBase</text> + <line stroke="black" stroke-opacity="1" x1="143" y1="54" x2="231" y2="54" /> + <line stroke="black" stroke-opacity="1" x1="143" y1="62" x2="231" y2="62" /> +</g> + <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" x="273" y="152">Common GL Stuff</text> +<g> + <rect fill="#808080" stroke="none" stroke-opacity="1" x="364" y="230" width="3" height="57" /> + <rect fill="#808080" stroke="none" stroke-opacity="1" x="280" y="284" width="87" height="3" /> + <rect fill="#ffffc0" stroke="black" stroke-width="1" stroke-opacity="1" x="276" y="226" width="88" height="58" /> + <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" text-anchor="middle" x="320" y="238"><<interface>></text> + <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" font-weight="bold" text-anchor="middle" x="320" y="259">GL2ES2</text> + <line stroke="black" stroke-opacity="1" x1="276" y1="268" x2="364" y2="268" /> + <line stroke="black" stroke-opacity="1" x1="276" y1="276" x2="364" y2="276" /> +</g> + <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" x="605" y="653">Desktop final public</text> + <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" x="605" y="671">OpenGL Interfaces</text> +<g> + <rect fill="#808080" stroke="none" stroke-opacity="1" x="580" y="688" width="3" height="57" /> + <rect fill="#808080" stroke="none" stroke-opacity="1" x="496" y="742" width="87" height="3" /> + <rect fill="#ffffc0" stroke="black" stroke-width="1" stroke-opacity="1" x="492" y="684" width="88" height="58" /> + <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" text-anchor="middle" x="536" y="696"><<interface>></text> + <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" font-weight="bold" text-anchor="middle" x="536" y="717">GL3</text> + <line stroke="black" stroke-opacity="1" x1="492" y1="726" x2="580" y2="726" /> + <line stroke="black" stroke-opacity="1" x1="492" y1="734" x2="580" y2="734" /> +</g> + <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" x="607" y="444">Mobile final public</text> + <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" x="607" y="462">OpenGL Interfaces</text> +<g> + <rect fill="#808080" stroke="none" stroke-opacity="1" x="365" y="405" width="3" height="57" /> + <rect fill="#808080" stroke="none" stroke-opacity="1" x="281" y="459" width="87" height="3" /> + <rect fill="#ffffc0" stroke="black" stroke-width="1" stroke-opacity="1" x="277" y="401" width="88" height="58" /> + <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" text-anchor="middle" x="321" y="413"><<interface>></text> + <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" font-weight="bold" text-anchor="middle" x="321" y="434">GLES2</text> + <line stroke="black" stroke-opacity="1" x1="277" y1="443" x2="365" y2="443" /> + <line stroke="black" stroke-opacity="1" x1="277" y1="451" x2="365" y2="451" /> +</g> +<g> + <rect fill="#808080" stroke="none" stroke-opacity="1" x="606" y="26" width="3" height="35" /> + <rect fill="#808080" stroke="none" stroke-opacity="1" x="538" y="58" width="71" height="3" /> + <rect fill="#ffffc0" stroke="black" stroke-width="1" stroke-opacity="1" x="534" y="22" width="72" height="36" /> + <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" font-weight="bold" font-style="italic" text-anchor="middle" x="570" y="34">GLContext</text> + <line stroke="black" stroke-opacity="1" x1="534" y1="43" x2="606" y2="43" /> + <line stroke="black" stroke-opacity="1" x1="534" y1="51" x2="606" y2="51" /> +</g> +<g> + <rect fill="#808080" stroke="none" stroke-opacity="1" x="748" y="120" width="3" height="35" /> + <rect fill="#808080" stroke="none" stroke-opacity="1" x="670" y="152" width="81" height="3" /> + <rect fill="#ffffc0" stroke="black" stroke-width="1" stroke-opacity="1" x="666" y="116" width="82" height="36" /> + <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" font-weight="bold" font-style="italic" text-anchor="middle" x="707" y="128">GLDrawable</text> + <line stroke="black" stroke-opacity="1" x1="666" y1="137" x2="748" y2="137" /> + <line stroke="black" stroke-opacity="1" x1="666" y1="145" x2="748" y2="145" /> +</g> + <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" x="606" y="346">Common Desktop</text> + <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" x="606" y="364">Profile</text> +<g> + <rect fill="#808080" stroke="none" stroke-opacity="1" x="579" y="848" width="3" height="57" /> + <rect fill="#808080" stroke="none" stroke-opacity="1" x="495" y="902" width="87" height="3" /> + <rect fill="#ffffc0" stroke="black" stroke-width="1" stroke-opacity="1" x="491" y="844" width="88" height="58" /> + <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" text-anchor="middle" x="535" y="856"><<interface>></text> + <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" font-weight="bold" text-anchor="middle" x="535" y="877">GL4</text> + <line stroke="black" stroke-opacity="1" x1="491" y1="886" x2="579" y2="886" /> + <line stroke="black" stroke-opacity="1" x1="491" y1="894" x2="579" y2="894" /> +</g> +<g> + <rect fill="#808080" stroke="none" stroke-opacity="1" x="285" y="909" width="3" height="57" /> + <rect fill="#808080" stroke="none" stroke-opacity="1" x="201" y="963" width="87" height="3" /> + <rect fill="#ffffc0" stroke="black" stroke-width="1" stroke-opacity="1" x="197" y="905" width="88" height="58" /> + <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" text-anchor="middle" x="241" y="917"><<interface>></text> + <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" font-weight="bold" text-anchor="middle" x="241" y="938">GL4bc</text> + <line stroke="black" stroke-opacity="1" x1="197" y1="947" x2="285" y2="947" /> + <line stroke="black" stroke-opacity="1" x1="197" y1="955" x2="285" y2="955" /> +</g> +<g> + <line stroke="black" stroke-opacity="1" x1="206" y1="308" x2="226" y2="308" /> + <ellipse fill="#ffffc0" stroke="black" stroke-width="1" stroke-opacity="1" cx="216" cy="298" rx="10" ry="10" /> + <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" font-weight="bold" text-anchor="middle" x="216" y="320">GL2ES12</text> + <line stroke="black" stroke-opacity="1" x1="184" y1="329" x2="248" y2="329" /> + <line stroke="black" stroke-opacity="1" x1="184" y1="337" x2="248" y2="337" /> +</g> +<g> + <line stroke="black" stroke-opacity="1" x1="289" y1="778" x2="485" y2="726" /> + <line stroke="black" stroke-opacity="1" x1="491" y1="725" x2="483" y2="720" /> + <line stroke="black" stroke-opacity="1" x1="491" y1="725" x2="486" y2="732" /> + <line stroke="black" stroke-opacity="1" x1="483" y1="720" x2="486" y2="732" /> +</g> +<g> + <line stroke-dasharray="4,4" stroke="black" stroke-opacity="1" x1="417" y1="1047" x2="510" y2="910" /> + <line stroke="black" stroke-opacity="1" x1="514" y1="906" x2="505" y2="907" /> + <line stroke="black" stroke-opacity="1" x1="514" y1="906" x2="515" y2="914" /> + <line stroke="black" stroke-opacity="1" x1="505" y1="907" x2="515" y2="914" /> +</g> +<g> + <line stroke-dasharray="4,4" stroke="black" stroke-opacity="1" x1="248" y1="296" x2="269" y2="283" /> + <line stroke="black" stroke-opacity="1" x1="275" y1="280" x2="266" y2="277" /> + <line stroke="black" stroke-opacity="1" x1="275" y1="280" x2="272" y2="288" /> + <line stroke="black" stroke-opacity="1" x1="266" y1="277" x2="272" y2="288" /> +</g> +<g> + <line stroke-dasharray="4,4" stroke="black" stroke-opacity="1" x1="388" y1="1047" x2="257" y2="682" /> + <line stroke="black" stroke-opacity="1" x1="255" y1="677" x2="251" y2="684" /> + <line stroke="black" stroke-opacity="1" x1="255" y1="677" x2="262" y2="680" /> + <line stroke="black" stroke-opacity="1" x1="251" y1="684" x2="262" y2="680" /> +</g> +<g> + <line stroke="black" stroke-opacity="1" x1="243" y1="760" x2="243" y2="682" /> + <line stroke="black" stroke-opacity="1" x1="244" y1="677" x2="237" y2="682" /> + <line stroke="black" stroke-opacity="1" x1="244" y1="677" x2="249" y2="683" /> + <line stroke="black" stroke-opacity="1" x1="237" y1="682" x2="249" y2="683" /> +</g> +<g> + <line stroke="black" stroke-opacity="1" x1="243" y1="904" x2="243" y2="829" /> + <line stroke="black" stroke-opacity="1" x1="243" y1="823" x2="237" y2="829" /> + <line stroke="black" stroke-opacity="1" x1="243" y1="823" x2="249" y2="829" /> + <line stroke="black" stroke-opacity="1" x1="237" y1="829" x2="249" y2="829" /> +</g> +<g> + <line stroke-dasharray="4,4" stroke="black" stroke-opacity="1" x1="183" y1="300" x2="139" y2="279" /> + <line stroke="black" stroke-opacity="1" x1="134" y1="277" x2="136" y2="284" /> + <line stroke="black" stroke-opacity="1" x1="134" y1="277" x2="141" y2="274" /> + <line stroke="black" stroke-opacity="1" x1="136" y1="284" x2="141" y2="274" /> +</g> +<g> + <line stroke="black" stroke-opacity="1" x1="537" y1="843" x2="537" y2="752" /> + <line stroke="black" stroke-opacity="1" x1="537" y1="746" x2="531" y2="752" /> + <line stroke="black" stroke-opacity="1" x1="537" y1="746" x2="543" y2="752" /> + <line stroke="black" stroke-opacity="1" x1="531" y1="752" x2="543" y2="752" /> +</g> +<g> + <line stroke="black" stroke-opacity="1" x1="289" y1="925" x2="484" y2="884" /> + <line stroke="black" stroke-opacity="1" x1="490" y1="883" x2="482" y2="878" /> + <line stroke="black" stroke-opacity="1" x1="490" y1="883" x2="485" y2="890" /> + <line stroke="black" stroke-opacity="1" x1="482" y1="878" x2="485" y2="890" /> +</g> +<g> + <line stroke-dasharray="4,4" stroke="black" stroke-opacity="1" x1="366" y1="1047" x2="281" y2="971" /> + <line stroke="black" stroke-opacity="1" x1="277" y1="967" x2="277" y2="975" /> + <line stroke="black" stroke-opacity="1" x1="277" y1="967" x2="285" y2="966" /> + <line stroke="black" stroke-opacity="1" x1="277" y1="975" x2="285" y2="966" /> +</g> +<g> + <line stroke-dasharray="4,4" stroke="black" stroke-opacity="1" x1="383" y1="1047" x2="262" y2="828" /> + <line stroke="black" stroke-opacity="1" x1="260" y1="823" x2="257" y2="831" /> + <line stroke="black" stroke-opacity="1" x1="260" y1="823" x2="268" y2="825" /> + <line stroke="black" stroke-opacity="1" x1="257" y1="831" x2="268" y2="825" /> +</g> +<g> + <line stroke="black" stroke-opacity="1" x1="76" y1="504" x2="96" y2="504" /> + <ellipse fill="#ffffc0" stroke="black" stroke-width="1" stroke-opacity="1" cx="86" cy="494" rx="10" ry="10" /> + <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" font-weight="bold" text-anchor="middle" x="86" y="516">GLES1Impl</text> + <line stroke="black" stroke-opacity="1" x1="47" y1="525" x2="125" y2="525" /> + <line stroke="black" stroke-opacity="1" x1="47" y1="533" x2="125" y2="533" /> +</g> +<g> + <rect fill="#808080" stroke="none" stroke-opacity="1" x="887" y="403" width="3" height="35" /> + <rect fill="#808080" stroke="none" stroke-opacity="1" x="811" y="435" width="79" height="3" /> + <rect fill="#ffffc0" stroke="black" stroke-width="1" stroke-opacity="1" x="807" y="399" width="80" height="36" /> + <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" font-weight="bold" text-anchor="middle" x="847" y="411">Capabilities</text> + <line stroke="black" stroke-opacity="1" x1="807" y1="420" x2="887" y2="420" /> + <line stroke="black" stroke-opacity="1" x1="807" y1="428" x2="887" y2="428" /> +</g> +<g> + <rect fill="#808080" stroke="none" stroke-opacity="1" x="581" y="320" width="3" height="57" /> + <rect fill="#808080" stroke="none" stroke-opacity="1" x="497" y="374" width="87" height="3" /> + <rect fill="#ffffc0" stroke="black" stroke-width="1" stroke-opacity="1" x="493" y="316" width="88" height="58" /> + <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" text-anchor="middle" x="537" y="328"><<interface>></text> + <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" font-weight="bold" text-anchor="middle" x="537" y="349">GL2GL3</text> + <line stroke="black" stroke-opacity="1" x1="493" y1="358" x2="581" y2="358" /> + <line stroke="black" stroke-opacity="1" x1="493" y1="366" x2="581" y2="366" /> +</g> +<g> + <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" x="585" y="76">0..1</text> +</g> +<g> + <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" x="652" y="116">1</text> +</g> +<g> + <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" x="825" y="386">chosen</text> +</g> +<g> + <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" x="798" y="386">1</text> +</g> +<g> + <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" x="892" y="386">requested</text> +</g> +<g> + <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" x="865" y="386">1</text> +</g> +<g> + <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" x="516" y="60">1</text> +</g> +<g> + <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" x="247" y="60">1</text> +</g> +</svg> diff --git a/doc/bouml/html-svg/index-withframe.html b/doc/bouml/html-svg/index-withframe.html new file mode 100644 index 000000000..96f19466e --- /dev/null +++ b/doc/bouml/html-svg/index-withframe.html @@ -0,0 +1,19 @@ +<!-- Documentation produced by the Html generator of Bouml (http://bouml.free.fr) --> +<?xml version="1.0" encoding="UTF-8"?> +<!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" xmlns:svg="http://www.w3.org/2000/svg"> + +<head> +<title>/usr/local/projects/JOGL/jogl/doc/bouml/svg-flat/index-withframe</title> +<link rel="stylesheet" href="style.css" type="text/css" /> +</head> +<FRAMESET cols="20%,80%"> + <FRAME src="classes_list.html" name="classesListFrame"> + <FRAMESET rows="150,*"> + <FRAME src="navig.html" name="navigFrame"> + <FRAME src="index.html" name="projectFrame"> + </FRAMESET> +</FRAMESET> +<NOFRAMES> +<H2>Frame Alert</H2><P>This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client.<BR>Link to <A HREF="index.html">Non-frame version.</A></NOFRAMES></body> +</html> diff --git a/doc/bouml/html-svg/index.html b/doc/bouml/html-svg/index.html new file mode 100644 index 000000000..c25ed5182 --- /dev/null +++ b/doc/bouml/html-svg/index.html @@ -0,0 +1,238 @@ +<!-- Documentation produced by the Html generator of Bouml (http://bouml.free.fr) --> +<?xml version="1.0" encoding="UTF-8"?> +<!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" xmlns:svg="http://www.w3.org/2000/svg"> + +<head> +<title>jogl +Documentation</title> +<link rel="stylesheet" href="style.css" type="text/css" /> +</head> + +<body bgcolor="#ffffff"> + +<div class = "title">jogl<br />Documentation</div> +<p></p> + +<!-- ============================================================= --> + +<a name="refpackage129"></a> +<p>Properties:<ul> +<li>html dir:<br /><div class="sub">/usr/local/projects/JOGL/jogl/doc/bouml/svg-flat/</div></p></li> +</ul></p> +<a name="refclass view128069"></a> +<h1 class ="view">1 Class View javax.media.opengl</h1> +<div class="sub"> +<a name="refclass diagram128069"></a> +<p align="center"><embed src="fig128069.svg" width="1003" height="1180"/></p> + <p align="center"><b>OpenGL Interfaces</b></p><p><br /></p><p><br /></p> +<a name="refclass128069"></a> +<h2 class ="class">1.1 Class GL</h2> +<p>Declaration :</p><ul> +<li>Java : public interface GL extends <a href="index.html#refclass132549"><b>GLBase</b></a> </li><li>Php : public interface GL </li></ul><p>Directly inherited by : <a href="index.html#refclass128197"><b>GL2ES1</b></a> <a href="index.html#refclass128581"><b>GL2ES2</b></a> </p> +<p>Stereotype: interface</p> +<div class="sub"> +<div class="sub"> +</div> +</div> +<a name="refclass128197"></a> +<h2 class ="class">1.2 Class GL2ES1</h2> +<p>Declaration :</p><ul> +<li>Java : public interface GL2ES1 extends <a href="index.html#refclass128069"><b>GL</b></a> </li><li>Php : public interface GL2ES1 </li></ul><p>Directly inherited by : <a href="index.html#refclass128453"><b>GL2</b></a> <a href="index.html#refclass128386"><b>GL2ES12</b></a> <a href="index.html#refclass128325"><b>GLES1</b></a> </p> +<p>Stereotype: interface</p> +<div class="sub"> +<div class="sub"> +</div> +</div> +<a name="refclass128325"></a> +<h2 class ="class">1.3 Class GLES1</h2> +<p>Declaration :</p><ul> +<li>Java : public interface GLES1 extends <a href="index.html#refclass128197"><b>GL2ES1</b></a> </li><li>Php : public interface GLES1 </li></ul><p>Directly inherited by : <a href="index.html#refclass130757"><b>GLES1Impl</b></a> </p> +<p>Stereotype: interface</p> +<div class="sub"> +<div class="sub"> +</div> +</div> +<a name="refclass128453"></a> +<h2 class ="class">1.4 Class GL2</h2> +<p>Declaration :</p><ul> +<li>Java : public interface GL2 extends <a href="index.html#refclass128709"><b>GL2GL3</b></a> </li><li>Php : public interface GL2 </li></ul><p>Directly inherited by : <a href="index.html#refclass128002"><b>GL3bc</b></a> <a href="index.html#refclass130501"><b>GL4bcImpl</b></a> </p> +<p>Stereotype: interface</p> +<div class="sub"> +<div class="sub"> +</div> +</div> +<a name="refclass128581"></a> +<h2 class ="class">1.5 Class GL2ES2</h2> +<p>Declaration :</p><ul> +<li>Java : public interface GL2ES2 extends <a href="index.html#refclass128069"><b>GL</b></a> </li><li>Php : public interface GL2ES2 </li></ul><p>Directly inherited by : <a href="index.html#refclass128386"><b>GL2ES12</b></a> <a href="index.html#refclass128709"><b>GL2GL3</b></a> <a href="index.html#refclass128965"><b>GLES2</b></a> </p> +<p>Stereotype: interface</p> +<div class="sub"> +<div class="sub"> +</div> +</div> +<a name="refclass128709"></a> +<h2 class ="class">1.6 Class GL2GL3</h2> +<p>Declaration :</p><ul> +<li>Java : public interface GL2GL3 extends <a href="index.html#refclass128581"><b>GL2ES2</b></a> </li><li>Php : public interface GL2GL3 </li></ul><p>Directly inherited by : <a href="index.html#refclass128453"><b>GL2</b></a> <a href="index.html#refclass128837"><b>GL3</b></a> </p> +<p>Stereotype: interface</p> +<div class="sub"> +<div class="sub"> +</div> +</div> +<a name="refclass128837"></a> +<h2 class ="class">1.7 Class GL3</h2> +<p>Declaration :</p><ul> +<li>Java : public interface GL3 extends <a href="index.html#refclass128709"><b>GL2GL3</b></a> </li><li>Php : public interface GL3 </li></ul><p>Directly inherited by : <a href="index.html#refclass128002"><b>GL3bc</b></a> <a href="index.html#refclass128130"><b>GL4</b></a> <a href="index.html#refclass130501"><b>GL4bcImpl</b></a> </p> +<p>Stereotype: interface</p> +<div class="sub"> +<div class="sub"> +</div> +</div> +<a name="refclass128965"></a> +<h2 class ="class">1.8 Class GLES2</h2> +<p>Declaration :</p><ul> +<li>Java : public interface GLES2 extends <a href="index.html#refclass128581"><b>GL2ES2</b></a> </li><li>Php : public interface GLES2 </li></ul><p>Directly inherited by : <a href="index.html#refclass130629"><b>GLES2Impl</b></a> </p> +<p>Stereotype: interface</p> +<div class="sub"> +<div class="sub"> +</div> +</div> +<a name="refclass130117"></a> +<h2 class ="class">1.9 Class GLContext</h2> +<p>Declaration :</p><ul> +<li>Java : package abstract class GLContext </li></ul><div class="sub"> +<div class="sub"> +<a name="refrelation130757"></a> +<table><tr><td><div class="element">Relation <b><association></b></div></td></tr></table><p>Declaration :</p><ul><li>Uml : - : <a href="index.html#refclass130245"><b>GLDrawable</b></a>, multiplicity : 1</li><li>Java : private <a href="index.html#refclass130245"><b>GLDrawable</b></a> </li></ul><a name="refrelation134341"></a> +<table><tr><td><div class="element">Relation <b><association></b></div></td></tr></table><p>Declaration :</p><ul><li>Uml : - : <a href="index.html#refclass132549"><b>GLBase</b></a>, multiplicity : 1</li><li>Java : private <a href="index.html#refclass132549"><b>GLBase</b></a> </li></ul></div> +</div> +<a name="refclass130245"></a> +<h2 class ="class">1.10 Class GLDrawable</h2> +<p>Declaration :</p><ul> +<li>Java : package abstract class GLDrawable </li></ul><div class="sub"> +<div class="sub"> +<a name="refrelation130629"></a> +<table><tr><td><div class="element">Relation <b><association></b></div></td></tr></table><p>Declaration :</p><ul><li>Uml : - : <a href="index.html#refclass130117"><b>GLContext</b></a>, multiplicity : 0..1</li><li>Java : private <a href="index.html#refclass130117"><b>GLContext</b></a> </li></ul><a name="refrelation132421"></a> +<table><tr><td><div class="element">Relation <b><association></b></div></td></tr></table><p>Declaration :</p><ul><li>Uml : - : <a href="index.html#refclass130885"><b>NativeWindow</b></a></li><li>Java : private <a href="index.html#refclass130885"><b>NativeWindow</b></a> </li></ul></div> +</div> +<a name="refclass130501"></a> +<h2 class ="class">1.11 Class GL4bcImpl</h2> +<p>Declaration :</p><ul> +<li>Java : private class GL4bcImpl implements <a href="index.html#refclass128837"><b>GL3</b></a>, <a href="index.html#refclass128002"><b>GL3bc</b></a>, <a href="index.html#refclass128258"><b>GL4bc</b></a>, <a href="index.html#refclass128453"><b>GL2</b></a>, <a href="index.html#refclass128130"><b>GL4</b></a> </li></ul><p>Stereotype: entity</p> +<div class="sub"> +<div class="sub"> +</div> +</div> +<a name="refclass130629"></a> +<h2 class ="class">1.12 Class GLES2Impl</h2> +<p>Declaration :</p><ul> +<li>Java : private class GLES2Impl implements <a href="index.html#refclass128965"><b>GLES2</b></a> </li></ul><p>Stereotype: entity</p> +<div class="sub"> +<div class="sub"> +</div> +</div> +<a name="refclass130757"></a> +<h2 class ="class">1.13 Class GLES1Impl</h2> +<p>Declaration :</p><ul> +<li>Java : private class GLES1Impl implements <a href="index.html#refclass128325"><b>GLES1</b></a> </li></ul><p>Stereotype: entity</p> +<div class="sub"> +<div class="sub"> +</div> +</div> +<a name="refclass130885"></a> +<h2 class ="class">1.14 Class NativeWindow</h2> +<p>Declaration :</p><ul> +<li>Java : package interface NativeWindow </li><li>Php : interface NativeWindow </li></ul><p>Stereotype: interface</p> +<div class="sub"> +<div class="sub"> +<a name="refrelation132165"></a> +<table><tr><td><div class="element">Relation <b><association></b></div></td></tr></table><p>Declaration :</p><ul><li>Uml : - : <a href="index.html#refclass131013"><b>AbstractGraphicsConfiguration</b></a></li><li>Java : private <a href="index.html#refclass131013"><b>AbstractGraphicsConfiguration</b></a> </li></ul><a name="refrelation132293"></a> +<table><tr><td><div class="element">Relation <b><association></b></div></td></tr></table><p>Declaration :</p><ul><li>Uml : - : <a href="index.html#refclass130245"><b>GLDrawable</b></a></li><li>Java : private <a href="index.html#refclass130245"><b>GLDrawable</b></a> </li></ul></div> +</div> +<a name="refclass131013"></a> +<h2 class ="class">1.15 Class AbstractGraphicsConfiguration</h2> +<p>Declaration :</p><ul> +<li>Java : package abstract class AbstractGraphicsConfiguration </li></ul><div class="sub"> +<div class="sub"> +<a name="refrelation131525"></a> +<table><tr><td><div class="element">Relation <b>chosen (<association>)</b></div></td></tr></table><p>Declaration :</p><ul><li>Uml : - chosen : <a href="index.html#refclass131269"><b>Capabilities</b></a>, multiplicity : 1</li><li>Java : private <a href="index.html#refclass131269"><b>Capabilities</b></a> chosen</li></ul><a name="refrelation131909"></a> +<table><tr><td><div class="element">Relation <b><association></b></div></td></tr></table><p>Declaration :</p><ul><li>Uml : - requested : <a href="index.html#refclass131269"><b>Capabilities</b></a>, multiplicity : 1</li><li>Java : private <a href="index.html#refclass131269"><b>Capabilities</b></a> requested</li></ul><a name="refrelation132037"></a> +<table><tr><td><div class="element">Relation <b><association></b></div></td></tr></table><p>Declaration :</p><ul><li>Uml : - : <a href="index.html#refclass130885"><b>NativeWindow</b></a></li><li>Java : private <a href="index.html#refclass130885"><b>NativeWindow</b></a> </li></ul></div> +</div> +<a name="refclass131141"></a> +<h2 class ="class">1.16 Class GLCapabilities</h2> +<p>Declaration :</p><ul> +<li>Java : package class GLCapabilities extends <a href="index.html#refclass131269"><b>Capabilities</b></a> </li></ul><div class="sub"> +<div class="sub"> +<a name="refrelation132677"></a> +<table><tr><td><div class="element">Relation <b><association></b></div></td></tr></table><p>Declaration :</p><ul><li>Uml : - : <a href="index.html#refclass131397"><b>GLProfile</b></a></li><li>Java : private <a href="index.html#refclass131397"><b>GLProfile</b></a> </li></ul><a name="refrelation132933"></a> +<table><tr><td><div class="element">Relation <b><association></b></div></td></tr></table><p>Declaration :</p><ul><li>Uml : - : <a href="index.html#refclass131397"><b>GLProfile</b></a></li><li>Java : private <a href="index.html#refclass131397"><b>GLProfile</b></a> </li></ul></div> +</div> +<a name="refclass131269"></a> +<h2 class ="class">1.17 Class Capabilities</h2> +<p>Declaration :</p><ul> +<li>Java : package class Capabilities </li></ul><p>Directly inherited by : <a href="index.html#refclass131141"><b>GLCapabilities</b></a> </p> +<div class="sub"> +<div class="sub"> +<a name="refrelation131653"></a> +<table><tr><td><div class="element">Relation <b><association></b></div></td></tr></table><p>Declaration :</p><ul><li>Uml : - : <a href="index.html#refclass131013"><b>AbstractGraphicsConfiguration</b></a></li><li>Java : private <a href="index.html#refclass131013"><b>AbstractGraphicsConfiguration</b></a> </li></ul><a name="refrelation131781"></a> +<table><tr><td><div class="element">Relation <b><association></b></div></td></tr></table><p>Declaration :</p><ul><li>Uml : - : <a href="index.html#refclass131013"><b>AbstractGraphicsConfiguration</b></a></li><li>Java : private <a href="index.html#refclass131013"><b>AbstractGraphicsConfiguration</b></a> </li></ul></div> +</div> +<a name="refclass131397"></a> +<h2 class ="class">1.18 Class GLProfile</h2> +<p>Declaration :</p><ul> +<li>Java : package class GLProfile </li></ul><div class="sub"> +<div class="sub"> +<a name="refrelation132549"></a> +<table><tr><td><div class="element">Relation <b><association></b></div></td></tr></table><p>Declaration :</p><ul><li>Uml : - : <a href="index.html#refclass131141"><b>GLCapabilities</b></a></li><li>Java : private <a href="index.html#refclass131141"><b>GLCapabilities</b></a> </li></ul><a name="refrelation132805"></a> +<table><tr><td><div class="element">Relation <b><association></b></div></td></tr></table><p>Declaration :</p><ul><li>Uml : - : <a href="index.html#refclass131141"><b>GLCapabilities</b></a></li><li>Java : private <a href="index.html#refclass131141"><b>GLCapabilities</b></a> </li></ul></div> +</div> +<a name="refclass132549"></a> +<h2 class ="class">1.19 Class GLBase</h2> +<p>Declaration :</p><ul> +<li>Java : public interface GLBase </li><li>Php : public interface GLBase </li></ul><p>Directly inherited by : <a href="index.html#refclass128069"><b>GL</b></a> </p> +<p>Stereotype: interface</p> +<div class="sub"> +<div class="sub"> +<a name="refrelation134213"></a> +<table><tr><td><div class="element">Relation <b><association></b></div></td></tr></table><p>Declaration :</p><ul><li>Uml : - : <a href="index.html#refclass130117"><b>GLContext</b></a>, multiplicity : 1</li><li>Java : private <a href="index.html#refclass130117"><b>GLContext</b></a> </li></ul></div> +</div> +<a name="refclass128002"></a> +<h2 class ="class">1.20 Class GL3bc</h2> +<p>Declaration :</p><ul> +<li>Java : package interface GL3bc extends <a href="index.html#refclass128453"><b>GL2</b></a> </li><li>Php : interface GL3bc </li></ul><p>Directly inherited by : <a href="index.html#refclass128258"><b>GL4bc</b></a> <a href="index.html#refclass130501"><b>GL4bcImpl</b></a> </p> +<p>Stereotype: interface</p> +<div class="sub"> +<div class="sub"> +</div> +</div> +<a name="refclass128130"></a> +<h2 class ="class">1.21 Class GL4</h2> +<p>Declaration :</p><ul> +<li>Java : package interface GL4 extends <a href="index.html#refclass128837"><b>GL3</b></a> </li><li>Php : interface GL4 </li></ul><p>Directly inherited by : <a href="index.html#refclass128258"><b>GL4bc</b></a> <a href="index.html#refclass130501"><b>GL4bcImpl</b></a> </p> +<p>Stereotype: interface</p> +<div class="sub"> +<div class="sub"> +</div> +</div> +<a name="refclass128258"></a> +<h2 class ="class">1.22 Class GL4bc</h2> +<p>Declaration :</p><ul> +<li>Java : package interface GL4bc extends <a href="index.html#refclass128002"><b>GL3bc</b></a> </li><li>Php : interface GL4bc </li></ul><p>Directly inherited by : <a href="index.html#refclass130501"><b>GL4bcImpl</b></a> </p> +<p>Stereotype: interface</p> +<div class="sub"> +<div class="sub"> +</div> +</div> +<a name="refclass128386"></a> +<h2 class ="class">1.23 Class GL2ES12</h2> +<p>Declaration :</p><ul> +<li>Java : package class GL2ES12 implements <a href="index.html#refclass128197"><b>GL2ES1</b></a>, <a href="index.html#refclass128581"><b>GL2ES2</b></a> </li></ul><p>Stereotype: entity</p> +<div class="sub"> +<div class="sub"> +</div> +</div> +</div> +</body> +</html> diff --git a/doc/bouml/html-svg/index_65.html b/doc/bouml/html-svg/index_65.html new file mode 100644 index 000000000..9a6dedcaa --- /dev/null +++ b/doc/bouml/html-svg/index_65.html @@ -0,0 +1,23 @@ +<!-- Documentation produced by the Html generator of Bouml (http://bouml.free.fr) --> +<?xml version="1.0" encoding="UTF-8"?> +<!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" xmlns:svg="http://www.w3.org/2000/svg"> + +<head> +<title>A</title> +<link rel="stylesheet" href="style.css" type="text/css" /> +</head> + +<body bgcolor="#ffffff"> + +<div class = "title">A</div> +<p></p> + +<!-- ============================================================= --> + +<table> +<tr bgcolor=#f0f0f0><td align=center><b>Name</b></td><td align=center><b>Kind</b></td><td align=center><b>Description</b></td></tr> +<tr bgcolor=#f0f0f0><td><a href="index.html#refclass131013" target = "projectFrame"><b>AbstractGraphicsConfiguration</b></a></td><td>class</td><td></td></tr> +</table> +</body> +</html> diff --git a/doc/bouml/html-svg/index_67.html b/doc/bouml/html-svg/index_67.html new file mode 100644 index 000000000..630cc4999 --- /dev/null +++ b/doc/bouml/html-svg/index_67.html @@ -0,0 +1,24 @@ +<!-- Documentation produced by the Html generator of Bouml (http://bouml.free.fr) --> +<?xml version="1.0" encoding="UTF-8"?> +<!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" xmlns:svg="http://www.w3.org/2000/svg"> + +<head> +<title>C</title> +<link rel="stylesheet" href="style.css" type="text/css" /> +</head> + +<body bgcolor="#ffffff"> + +<div class = "title">C</div> +<p></p> + +<!-- ============================================================= --> + +<table> +<tr bgcolor=#f0f0f0><td align=center><b>Name</b></td><td align=center><b>Kind</b></td><td align=center><b>Description</b></td></tr> +<tr bgcolor=#f0f0f0><td><a href="index.html#refclass131269" target = "projectFrame"><b>Capabilities</b></a></td><td>class</td><td></td></tr> +<tr bgcolor=#f0f0f0><td><a href="index.html#refrelation131525" target = "projectFrame"><b>chosen</b></a></td><td>relation</td><td></td></tr> +</table> +</body> +</html> diff --git a/doc/bouml/html-svg/index_71.html b/doc/bouml/html-svg/index_71.html new file mode 100644 index 000000000..f09f91321 --- /dev/null +++ b/doc/bouml/html-svg/index_71.html @@ -0,0 +1,42 @@ +<!-- Documentation produced by the Html generator of Bouml (http://bouml.free.fr) --> +<?xml version="1.0" encoding="UTF-8"?> +<!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" xmlns:svg="http://www.w3.org/2000/svg"> + +<head> +<title>G</title> +<link rel="stylesheet" href="style.css" type="text/css" /> +</head> + +<body bgcolor="#ffffff"> + +<div class = "title">G</div> +<p></p> + +<!-- ============================================================= --> + +<table> +<tr bgcolor=#f0f0f0><td align=center><b>Name</b></td><td align=center><b>Kind</b></td><td align=center><b>Description</b></td></tr> +<tr bgcolor=#f0f0f0><td><a href="index.html#refclass128069" target = "projectFrame"><b>GL</b></a></td><td>class</td><td></td></tr> +<tr bgcolor=#f0f0f0><td><a href="index.html#refclass128453" target = "projectFrame"><b>GL2</b></a></td><td>class</td><td></td></tr> +<tr bgcolor=#f0f0f0><td><a href="index.html#refclass128197" target = "projectFrame"><b>GL2ES1</b></a></td><td>class</td><td></td></tr> +<tr bgcolor=#f0f0f0><td><a href="index.html#refclass128386" target = "projectFrame"><b>GL2ES12</b></a></td><td>class</td><td></td></tr> +<tr bgcolor=#f0f0f0><td><a href="index.html#refclass128581" target = "projectFrame"><b>GL2ES2</b></a></td><td>class</td><td></td></tr> +<tr bgcolor=#f0f0f0><td><a href="index.html#refclass128709" target = "projectFrame"><b>GL2GL3</b></a></td><td>class</td><td></td></tr> +<tr bgcolor=#f0f0f0><td><a href="index.html#refclass128837" target = "projectFrame"><b>GL3</b></a></td><td>class</td><td></td></tr> +<tr bgcolor=#f0f0f0><td><a href="index.html#refclass128002" target = "projectFrame"><b>GL3bc</b></a></td><td>class</td><td></td></tr> +<tr bgcolor=#f0f0f0><td><a href="index.html#refclass128130" target = "projectFrame"><b>GL4</b></a></td><td>class</td><td></td></tr> +<tr bgcolor=#f0f0f0><td><a href="index.html#refclass128258" target = "projectFrame"><b>GL4bc</b></a></td><td>class</td><td></td></tr> +<tr bgcolor=#f0f0f0><td><a href="index.html#refclass130501" target = "projectFrame"><b>GL4bcImpl</b></a></td><td>class</td><td></td></tr> +<tr bgcolor=#f0f0f0><td><a href="index.html#refclass132549" target = "projectFrame"><b>GLBase</b></a></td><td>class</td><td></td></tr> +<tr bgcolor=#f0f0f0><td><a href="index.html#refclass131141" target = "projectFrame"><b>GLCapabilities</b></a></td><td>class</td><td></td></tr> +<tr bgcolor=#f0f0f0><td><a href="index.html#refclass130117" target = "projectFrame"><b>GLContext</b></a></td><td>class</td><td></td></tr> +<tr bgcolor=#f0f0f0><td><a href="index.html#refclass130245" target = "projectFrame"><b>GLDrawable</b></a></td><td>class</td><td></td></tr> +<tr bgcolor=#f0f0f0><td><a href="index.html#refclass128325" target = "projectFrame"><b>GLES1</b></a></td><td>class</td><td></td></tr> +<tr bgcolor=#f0f0f0><td><a href="index.html#refclass130757" target = "projectFrame"><b>GLES1Impl</b></a></td><td>class</td><td></td></tr> +<tr bgcolor=#f0f0f0><td><a href="index.html#refclass128965" target = "projectFrame"><b>GLES2</b></a></td><td>class</td><td></td></tr> +<tr bgcolor=#f0f0f0><td><a href="index.html#refclass130629" target = "projectFrame"><b>GLES2Impl</b></a></td><td>class</td><td></td></tr> +<tr bgcolor=#f0f0f0><td><a href="index.html#refclass131397" target = "projectFrame"><b>GLProfile</b></a></td><td>class</td><td></td></tr> +</table> +</body> +</html> diff --git a/doc/bouml/html-svg/index_74.html b/doc/bouml/html-svg/index_74.html new file mode 100644 index 000000000..14ff3bec2 --- /dev/null +++ b/doc/bouml/html-svg/index_74.html @@ -0,0 +1,24 @@ +<!-- Documentation produced by the Html generator of Bouml (http://bouml.free.fr) --> +<?xml version="1.0" encoding="UTF-8"?> +<!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" xmlns:svg="http://www.w3.org/2000/svg"> + +<head> +<title>J</title> +<link rel="stylesheet" href="style.css" type="text/css" /> +</head> + +<body bgcolor="#ffffff"> + +<div class = "title">J</div> +<p></p> + +<!-- ============================================================= --> + +<table> +<tr bgcolor=#f0f0f0><td align=center><b>Name</b></td><td align=center><b>Kind</b></td><td align=center><b>Description</b></td></tr> +<tr bgcolor=#f0f0f0><td><a href="index.html#refclass view128069" target = "projectFrame"><b>javax.media.opengl</b></a></td><td>class view</td><td></td></tr> +<tr bgcolor=#f0f0f0><td><a href="index.html#refpackage129" target = "projectFrame"><b>jogl</b></a></td><td>package</td><td></td></tr> +</table> +</body> +</html> diff --git a/doc/bouml/html-svg/index_78.html b/doc/bouml/html-svg/index_78.html new file mode 100644 index 000000000..3273a2e71 --- /dev/null +++ b/doc/bouml/html-svg/index_78.html @@ -0,0 +1,23 @@ +<!-- Documentation produced by the Html generator of Bouml (http://bouml.free.fr) --> +<?xml version="1.0" encoding="UTF-8"?> +<!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" xmlns:svg="http://www.w3.org/2000/svg"> + +<head> +<title>N</title> +<link rel="stylesheet" href="style.css" type="text/css" /> +</head> + +<body bgcolor="#ffffff"> + +<div class = "title">N</div> +<p></p> + +<!-- ============================================================= --> + +<table> +<tr bgcolor=#f0f0f0><td align=center><b>Name</b></td><td align=center><b>Kind</b></td><td align=center><b>Description</b></td></tr> +<tr bgcolor=#f0f0f0><td><a href="index.html#refclass130885" target = "projectFrame"><b>NativeWindow</b></a></td><td>class</td><td></td></tr> +</table> +</body> +</html> diff --git a/doc/bouml/html-svg/index_79.html b/doc/bouml/html-svg/index_79.html new file mode 100644 index 000000000..7474a3309 --- /dev/null +++ b/doc/bouml/html-svg/index_79.html @@ -0,0 +1,23 @@ +<!-- Documentation produced by the Html generator of Bouml (http://bouml.free.fr) --> +<?xml version="1.0" encoding="UTF-8"?> +<!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" xmlns:svg="http://www.w3.org/2000/svg"> + +<head> +<title>O</title> +<link rel="stylesheet" href="style.css" type="text/css" /> +</head> + +<body bgcolor="#ffffff"> + +<div class = "title">O</div> +<p></p> + +<!-- ============================================================= --> + +<table> +<tr bgcolor=#f0f0f0><td align=center><b>Name</b></td><td align=center><b>Kind</b></td><td align=center><b>Description</b></td></tr> +<tr bgcolor=#f0f0f0><td><a href="index.html#refclass diagram128069" target = "projectFrame"><b>OpenGL Interfaces</b></a></td><td>class diagram</td><td></td></tr> +</table> +</body> +</html> diff --git a/doc/bouml/html-svg/index_82.html b/doc/bouml/html-svg/index_82.html new file mode 100644 index 000000000..c5dcd1dcd --- /dev/null +++ b/doc/bouml/html-svg/index_82.html @@ -0,0 +1,23 @@ +<!-- Documentation produced by the Html generator of Bouml (http://bouml.free.fr) --> +<?xml version="1.0" encoding="UTF-8"?> +<!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" xmlns:svg="http://www.w3.org/2000/svg"> + +<head> +<title>R</title> +<link rel="stylesheet" href="style.css" type="text/css" /> +</head> + +<body bgcolor="#ffffff"> + +<div class = "title">R</div> +<p></p> + +<!-- ============================================================= --> + +<table> +<tr bgcolor=#f0f0f0><td align=center><b>Name</b></td><td align=center><b>Kind</b></td><td align=center><b>Description</b></td></tr> +<tr bgcolor=#f0f0f0><td><a href="index.html#refrelation131909" target = "projectFrame"><b>requested</b></a></td><td>relation</td><td></td></tr> +</table> +</body> +</html> diff --git a/doc/bouml/html-svg/navig.html b/doc/bouml/html-svg/navig.html new file mode 100644 index 000000000..66b446d18 --- /dev/null +++ b/doc/bouml/html-svg/navig.html @@ -0,0 +1,17 @@ +<!-- Documentation produced by the Html generator of Bouml (http://bouml.free.fr) --> +<?xml version="1.0" encoding="UTF-8"?> +<!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" xmlns:svg="http://www.w3.org/2000/svg"> + +<head> +<title>/usr/local/projects/JOGL/jogl/doc/bouml/svg-flat/navig</title> +<link rel="stylesheet" href="style.css" type="text/css" /> +</head> +<body bgcolor="#ffffff"> +<p><hr noshade></p> +<p><a href="index.html" target = "projectFrame"><b> -Top- </b></a><a href="classes.html" target = "projectFrame"><b> -Classes- </b></a><a href="packages.html" target = "projectFrame"><b> -Packages- </b></a><a href="classdiagrams.html" target = "projectFrame"><b> -Class Diagrams- </b></a></p> +<p> +</p> +<p><a href="index_65.html" target = "projectFrame"><b> A </b></a><a href="index_67.html" target = "projectFrame"><b> C </b></a><a href="index_71.html" target = "projectFrame"><b> G </b></a><a href="index_74.html" target = "projectFrame"><b> J </b></a><a href="index_78.html" target = "projectFrame"><b> N </b></a><a href="index_79.html" target = "projectFrame"><b> O </b></a><a href="index_82.html" target = "projectFrame"><b> R </b></a></p> +</body> +</html> diff --git a/doc/bouml/html-svg/packages.html b/doc/bouml/html-svg/packages.html new file mode 100644 index 000000000..61017a207 --- /dev/null +++ b/doc/bouml/html-svg/packages.html @@ -0,0 +1,22 @@ +<!-- Documentation produced by the Html generator of Bouml (http://bouml.free.fr) --> +<?xml version="1.0" encoding="UTF-8"?> +<!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" xmlns:svg="http://www.w3.org/2000/svg"> + +<head> +<title>Packages Index</title> +<link rel="stylesheet" href="style.css" type="text/css" /> +</head> + +<body bgcolor="#ffffff"> + +<div class = "title">Packages Index</div> +<p></p> + +<!-- ============================================================= --> + +<table> +<tr bgcolor=#f0f0f0><td><a href="index.html#refpackage129" target = "projectFrame"><b>jogl</b></a></td><td></td><td></td></tr> +</table> +</body> +</html> diff --git a/doc/bouml/html-svg/style.css b/doc/bouml/html-svg/style.css new file mode 100644 index 000000000..3a10a8149 --- /dev/null +++ b/doc/bouml/html-svg/style.css @@ -0,0 +1,30 @@ +div.title { font-size: 150%; background: #87ceff; text-align: center; font-weight: bold; } + +div.sub { margin-left : 20px; } +div.element { background: #d3d3d3; } + +h1.package { background: #ffe4c4; } +h1.view { background: #98fb98; } + +h2.package { background: #ffe4c4; } +h2.view { background: #98fb98; } +h2.class { background: #87ceff; } +h2.usecase { background: #87ceff; } +h2.state { background: #87ceff; } +h2.activity { background: #87ceff; } + +h3.package { background: #ffe4c4; } +h3.view { background: #98fb98; } +h3.class { background: #87ceff; } +h3.usecase { background: #87ceff; } +h3.state { background: #87ceff; } +h3.stateregion { background: #87ceff; } +h3.activity { background: #87ceff; } + +h4.package { background: #ffe4c4; } +h4.view { background: #98fb98; } +h4.class { background: #87ceff; } +h4.usecase { background: #87ceff; } +h4.state { background: #87ceff; } +h4.stateregion { background: #87ceff; } +h4.activity { background: #87ceff; } diff --git a/doc/bouml/html/classes.html b/doc/bouml/html/classes.html index 79ae63a87..c0eff2e35 100644 --- a/doc/bouml/html/classes.html +++ b/doc/bouml/html/classes.html @@ -21,11 +21,14 @@ <tr bgcolor=#f0f0f0><td><a href="index.html#refclass128069" target = "projectFrame"><b>GL</b></a></td><td>interface</td><td></td></tr> <tr bgcolor=#f0f0f0><td><a href="index.html#refclass128453" target = "projectFrame"><b>GL2</b></a></td><td>interface</td><td></td></tr> <tr bgcolor=#f0f0f0><td><a href="index.html#refclass128197" target = "projectFrame"><b>GL2ES1</b></a></td><td>interface</td><td></td></tr> +<tr bgcolor=#f0f0f0><td><a href="index.html#refclass128386" target = "projectFrame"><b>GL2ES12</b></a></td><td>entity</td><td></td></tr> <tr bgcolor=#f0f0f0><td><a href="index.html#refclass128581" target = "projectFrame"><b>GL2ES2</b></a></td><td>interface</td><td></td></tr> <tr bgcolor=#f0f0f0><td><a href="index.html#refclass128709" target = "projectFrame"><b>GL2GL3</b></a></td><td>interface</td><td></td></tr> -<tr bgcolor=#f0f0f0><td><a href="index.html#refclass130373" target = "projectFrame"><b>GL2Impl</b></a></td><td>entity</td><td></td></tr> <tr bgcolor=#f0f0f0><td><a href="index.html#refclass128837" target = "projectFrame"><b>GL3</b></a></td><td>interface</td><td></td></tr> -<tr bgcolor=#f0f0f0><td><a href="index.html#refclass130501" target = "projectFrame"><b>GL3Impl</b></a></td><td>entity</td><td></td></tr> +<tr bgcolor=#f0f0f0><td><a href="index.html#refclass128002" target = "projectFrame"><b>GL3bc</b></a></td><td>interface</td><td></td></tr> +<tr bgcolor=#f0f0f0><td><a href="index.html#refclass128130" target = "projectFrame"><b>GL4</b></a></td><td>interface</td><td></td></tr> +<tr bgcolor=#f0f0f0><td><a href="index.html#refclass128258" target = "projectFrame"><b>GL4bc</b></a></td><td>interface</td><td></td></tr> +<tr bgcolor=#f0f0f0><td><a href="index.html#refclass130501" target = "projectFrame"><b>GL4bcImpl</b></a></td><td>entity</td><td></td></tr> <tr bgcolor=#f0f0f0><td><a href="index.html#refclass132549" target = "projectFrame"><b>GLBase</b></a></td><td>interface</td><td></td></tr> <tr bgcolor=#f0f0f0><td><a href="index.html#refclass131141" target = "projectFrame"><b>GLCapabilities</b></a></td><td></td><td></td></tr> <tr bgcolor=#f0f0f0><td><a href="index.html#refclass130117" target = "projectFrame"><b>GLContext</b></a></td><td></td><td></td></tr> diff --git a/doc/bouml/html/classes_list.html b/doc/bouml/html/classes_list.html index f59dad7f6..717f1b1c0 100644 --- a/doc/bouml/html/classes_list.html +++ b/doc/bouml/html/classes_list.html @@ -22,11 +22,14 @@ <a href="index.html#refclass128069" target = "projectFrame"><b>GL</b></a><br /> <a href="index.html#refclass128453" target = "projectFrame"><b>GL2</b></a><br /> <a href="index.html#refclass128197" target = "projectFrame"><b>GL2ES1</b></a><br /> +<a href="index.html#refclass128386" target = "projectFrame"><b>GL2ES12</b></a><br /> <a href="index.html#refclass128581" target = "projectFrame"><b>GL2ES2</b></a><br /> <a href="index.html#refclass128709" target = "projectFrame"><b>GL2GL3</b></a><br /> -<a href="index.html#refclass130373" target = "projectFrame"><b>GL2Impl</b></a><br /> <a href="index.html#refclass128837" target = "projectFrame"><b>GL3</b></a><br /> -<a href="index.html#refclass130501" target = "projectFrame"><b>GL3Impl</b></a><br /> +<a href="index.html#refclass128002" target = "projectFrame"><b>GL3bc</b></a><br /> +<a href="index.html#refclass128130" target = "projectFrame"><b>GL4</b></a><br /> +<a href="index.html#refclass128258" target = "projectFrame"><b>GL4bc</b></a><br /> +<a href="index.html#refclass130501" target = "projectFrame"><b>GL4bcImpl</b></a><br /> <a href="index.html#refclass132549" target = "projectFrame"><b>GLBase</b></a><br /> <a href="index.html#refclass131141" target = "projectFrame"><b>GLCapabilities</b></a><br /> <a href="index.html#refclass130117" target = "projectFrame"><b>GLContext</b></a><br /> diff --git a/doc/bouml/html/fig128069.png b/doc/bouml/html/fig128069.png Binary files differindex 4958dbab3..8acf16a2c 100644 --- a/doc/bouml/html/fig128069.png +++ b/doc/bouml/html/fig128069.png diff --git a/doc/bouml/html/fig128069.svg b/doc/bouml/html/fig128069.svg deleted file mode 100644 index 7d2f2a558..000000000 --- a/doc/bouml/html/fig128069.svg +++ /dev/null @@ -1,350 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!-- Created with Bouml (http://bouml.free.fr/) --> -<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> -<svg width="1003" height="814" version="1.1" xmlns="http://www.w3.org/2000/svg"> -<g> - <rect fill="#ededed" stroke="black" stroke-width="1" stroke-opacity="1" x="5" y="193" width="234" height="609" /> - <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" text-anchor="middle" x="52" y="210">Fixed Function</text> - <line stroke="black" stroke-opacity="1" x1="5" y1="217" x2="98" y2="217" /> - <line stroke="black" stroke-opacity="1" x1="98" y1="217" x2="110" y2="205" /> - <line stroke="black" stroke-opacity="1" x1="110" y1="205" x2="110" y2="193" /> -</g> -<g> - <line stroke="black" stroke-dasharray="20,4" stroke-opacity="1" x1="5" y1="392" x2="239" y2="392" /> -</g> -<g> - <line stroke="black" stroke-dasharray="20,4" stroke-opacity="1" x1="5" y1="569" x2="239" y2="569" /> -</g> -<g> - <line stroke="black" stroke-dasharray="20,4" stroke-opacity="1" x1="5" y1="304" x2="239" y2="304" /> -</g> -<g> - <rect fill="#c0ffff" stroke="black" stroke-width="1" stroke-opacity="1" x="238" y="193" width="447" height="609" /> - <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" text-anchor="middle" x="306" y="210">Programmable Shader</text> - <line stroke="black" stroke-opacity="1" x1="238" y1="217" x2="374" y2="217" /> - <line stroke="black" stroke-opacity="1" x1="374" y1="217" x2="386" y2="205" /> - <line stroke="black" stroke-opacity="1" x1="386" y1="205" x2="386" y2="193" /> -</g> -<g> - <line stroke="black" stroke-dasharray="20,4" stroke-opacity="1" x1="238" y1="392" x2="685" y2="392" /> -</g> -<g> - <line stroke="black" stroke-dasharray="20,4" stroke-opacity="1" x1="238" y1="569" x2="685" y2="569" /> -</g> -<g> - <line stroke="black" stroke-dasharray="20,4" stroke-opacity="1" x1="238" y1="304" x2="685" y2="304" /> -</g> -<g> - <line stroke="black" stroke-opacity="1" x1="115" y1="225" x2="154" y2="178" /> - <line stroke="black" stroke-opacity="1" x1="158" y1="174" x2="149" y2="174" /> - <line stroke="black" stroke-opacity="1" x1="158" y1="174" x2="158" y2="182" /> - <line stroke="black" stroke-opacity="1" x1="149" y1="174" x2="158" y2="182" /> -</g> -<g> - <line stroke="black" stroke-opacity="1" x1="285" y1="225" x2="231" y2="177" /> - <line stroke="black" stroke-opacity="1" x1="227" y1="174" x2="227" y2="182" /> - <line stroke="black" stroke-opacity="1" x1="227" y1="174" x2="235" y2="173" /> - <line stroke="black" stroke-opacity="1" x1="227" y1="182" x2="235" y2="173" /> -</g> -<g> - <line stroke="black" stroke-opacity="1" x1="88" y1="400" x2="88" y2="294" /> - <line stroke="black" stroke-opacity="1" x1="88" y1="288" x2="82" y2="294" /> - <line stroke="black" stroke-opacity="1" x1="88" y1="288" x2="94" y2="294" /> - <line stroke="black" stroke-opacity="1" x1="82" y1="294" x2="94" y2="294" /> -</g> -<g> - <line stroke="black" stroke-opacity="1" x1="323" y1="400" x2="323" y2="294" /> - <line stroke="black" stroke-opacity="1" x1="323" y1="288" x2="317" y2="294" /> - <line stroke="black" stroke-opacity="1" x1="323" y1="288" x2="329" y2="294" /> - <line stroke="black" stroke-opacity="1" x1="317" y1="294" x2="329" y2="294" /> -</g> -<g> - <line stroke="black" stroke-opacity="1" x1="476" y1="624" x2="476" y2="382" /> - <line stroke="black" stroke-opacity="1" x1="476" y1="376" x2="470" y2="382" /> - <line stroke="black" stroke-opacity="1" x1="476" y1="376" x2="482" y2="382" /> - <line stroke="black" stroke-opacity="1" x1="470" y1="382" x2="482" y2="382" /> -</g> -<g> - <line stroke="black" stroke-opacity="1" x1="270" y1="624" x2="447" y2="380" /> - <line stroke="black" stroke-opacity="1" x1="451" y1="376" x2="442" y2="377" /> - <line stroke="black" stroke-opacity="1" x1="451" y1="376" x2="452" y2="384" /> - <line stroke="black" stroke-opacity="1" x1="442" y1="377" x2="452" y2="384" /> -</g> -<g> - <line stroke="black" stroke-opacity="1" x1="429" y1="317" x2="375" y2="286" /> - <line stroke="black" stroke-opacity="1" x1="370" y1="284" x2="372" y2="292" /> - <line stroke="black" stroke-opacity="1" x1="370" y1="284" x2="378" y2="281" /> - <line stroke="black" stroke-opacity="1" x1="372" y1="292" x2="378" y2="281" /> -</g> -<g> - <line stroke="black" stroke-opacity="1" x1="236" y1="624" x2="103" y2="293" /> - <line stroke="black" stroke-opacity="1" x1="101" y1="288" x2="97" y2="295" /> - <line stroke="black" stroke-opacity="1" x1="101" y1="288" x2="108" y2="291" /> - <line stroke="black" stroke-opacity="1" x1="97" y1="295" x2="108" y2="291" /> -</g> -<g> - <line stroke="black" stroke-opacity="1" x1="679" y1="115" x2="601" y2="62" /> -</g> -<g> - <line stroke-dasharray="4,4" stroke="black" stroke-opacity="1" x1="88" y1="499" x2="88" y2="469" /> - <line stroke="black" stroke-opacity="1" x1="88" y1="463" x2="82" y2="469" /> - <line stroke="black" stroke-opacity="1" x1="88" y1="463" x2="94" y2="469" /> - <line stroke="black" stroke-opacity="1" x1="82" y1="469" x2="94" y2="469" /> -</g> -<g> - <line stroke-dasharray="4,4" stroke="black" stroke-opacity="1" x1="323" y1="499" x2="323" y2="469" /> - <line stroke="black" stroke-opacity="1" x1="323" y1="463" x2="317" y2="469" /> - <line stroke="black" stroke-opacity="1" x1="323" y1="463" x2="329" y2="469" /> - <line stroke="black" stroke-opacity="1" x1="317" y1="469" x2="329" y2="469" /> -</g> -<g> - <line stroke-dasharray="4,4" stroke="black" stroke-opacity="1" x1="476" y1="716" x2="476" y2="693" /> - <line stroke="black" stroke-opacity="1" x1="476" y1="687" x2="470" y2="693" /> - <line stroke="black" stroke-opacity="1" x1="476" y1="687" x2="482" y2="693" /> - <line stroke="black" stroke-opacity="1" x1="470" y1="693" x2="482" y2="693" /> -</g> -<g> - <line stroke-dasharray="4,4" stroke="black" stroke-opacity="1" x1="249" y1="716" x2="249" y2="693" /> - <line stroke="black" stroke-opacity="1" x1="249" y1="687" x2="243" y2="693" /> - <line stroke="black" stroke-opacity="1" x1="249" y1="687" x2="255" y2="693" /> - <line stroke="black" stroke-opacity="1" x1="243" y1="693" x2="255" y2="693" /> -</g> -<g> - <line stroke="black" stroke-opacity="1" x1="817" y1="450" x2="817" y2="429" /> - <line stroke="black" stroke-opacity="1" x1="817" y1="423" x2="811" y2="429" /> - <line stroke="black" stroke-opacity="1" x1="817" y1="423" x2="823" y2="429" /> - <line stroke="black" stroke-opacity="1" x1="811" y1="429" x2="823" y2="429" /> -</g> -<g> - <line stroke="black" stroke-opacity="1" x1="784" y1="328" x2="784" y2="382" /> -</g> -<g> - <line stroke="black" stroke-opacity="1" x1="819" y1="287" x2="819" y2="250" /> -</g> -<g> - <line stroke="black" stroke-opacity="1" x1="777" y1="187" x2="737" y2="156" /> -</g> -<g> - <line stroke="black" stroke-opacity="1" x1="817" y1="531" x2="817" y2="491" /> -</g> -<g> - <line stroke="black" stroke-opacity="1" x1="851" y1="382" x2="851" y2="328" /> -</g> -<g> - <line stroke="black" stroke-opacity="1" x1="817" y1="531" x2="817" y2="491" /> -</g> -<g> - <line stroke="black" stroke-opacity="1" x1="189" y1="111" x2="189" y2="80" /> - <line stroke="black" stroke-opacity="1" x1="189" y1="74" x2="183" y2="80" /> - <line stroke="black" stroke-opacity="1" x1="189" y1="74" x2="195" y2="80" /> - <line stroke="black" stroke-opacity="1" x1="183" y1="80" x2="195" y2="80" /> -</g> -<g> - <line stroke="black" stroke-opacity="1" x1="237" y1="42" x2="533" y2="42" /> -</g> -<g> - <rect fill="#808080" stroke="none" stroke-opacity="1" x="232" y="116" width="3" height="57" /> - <rect fill="#808080" stroke="none" stroke-opacity="1" x="146" y="170" width="89" height="3" /> - <rect fill="#ffffc0" stroke="black" stroke-width="1" stroke-opacity="1" x="142" y="112" width="90" height="58" /> - <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" text-anchor="middle" x="187" y="124"><<interface>></text> - <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" font-weight="bold" text-anchor="middle" x="187" y="145">GL</text> - <line stroke="black" stroke-opacity="1" x1="142" y1="154" x2="232" y2="154" /> - <line stroke="black" stroke-opacity="1" x1="142" y1="162" x2="232" y2="162" /> -</g> -<g> - <rect fill="#808080" stroke="none" stroke-opacity="1" x="132" y="230" width="3" height="57" /> - <rect fill="#808080" stroke="none" stroke-opacity="1" x="46" y="284" width="89" height="3" /> - <rect fill="#ffffc0" stroke="black" stroke-width="1" stroke-opacity="1" x="42" y="226" width="90" height="58" /> - <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" text-anchor="middle" x="87" y="238"><<interface>></text> - <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" font-weight="bold" text-anchor="middle" x="87" y="259">GL2ES1</text> - <line stroke="black" stroke-opacity="1" x1="42" y1="268" x2="132" y2="268" /> - <line stroke="black" stroke-opacity="1" x1="42" y1="276" x2="132" y2="276" /> -</g> -<g> - <rect fill="#808080" stroke="none" stroke-opacity="1" x="292" y="629" width="3" height="57" /> - <rect fill="#808080" stroke="none" stroke-opacity="1" x="206" y="683" width="89" height="3" /> - <rect fill="#ffffc0" stroke="black" stroke-width="1" stroke-opacity="1" x="202" y="625" width="90" height="58" /> - <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" text-anchor="middle" x="247" y="637"><<interface>></text> - <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" font-weight="bold" text-anchor="middle" x="247" y="658">GL2</text> - <line stroke="black" stroke-opacity="1" x1="202" y1="667" x2="292" y2="667" /> - <line stroke="black" stroke-opacity="1" x1="202" y1="675" x2="292" y2="675" /> -</g> -<g> - <rect fill="#808080" stroke="none" stroke-opacity="1" x="366" y="230" width="3" height="57" /> - <rect fill="#808080" stroke="none" stroke-opacity="1" x="280" y="284" width="89" height="3" /> - <rect fill="#ffffc0" stroke="black" stroke-width="1" stroke-opacity="1" x="276" y="226" width="90" height="58" /> - <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" text-anchor="middle" x="321" y="238"><<interface>></text> - <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" font-weight="bold" text-anchor="middle" x="321" y="259">GL2ES2</text> - <line stroke="black" stroke-opacity="1" x1="276" y1="268" x2="366" y2="268" /> - <line stroke="black" stroke-opacity="1" x1="276" y1="276" x2="366" y2="276" /> -</g> -<g> - <rect fill="#808080" stroke="none" stroke-opacity="1" x="519" y="629" width="3" height="57" /> - <rect fill="#808080" stroke="none" stroke-opacity="1" x="433" y="683" width="89" height="3" /> - <rect fill="#ffffc0" stroke="black" stroke-width="1" stroke-opacity="1" x="429" y="625" width="90" height="58" /> - <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" text-anchor="middle" x="474" y="637"><<interface>></text> - <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" font-weight="bold" text-anchor="middle" x="474" y="658">GL3</text> - <line stroke="black" stroke-opacity="1" x1="429" y1="667" x2="519" y2="667" /> - <line stroke="black" stroke-opacity="1" x1="429" y1="675" x2="519" y2="675" /> -</g> -<g> - <rect fill="#808080" stroke="none" stroke-opacity="1" x="367" y="405" width="3" height="57" /> - <rect fill="#808080" stroke="none" stroke-opacity="1" x="281" y="459" width="89" height="3" /> - <rect fill="#ffffc0" stroke="black" stroke-width="1" stroke-opacity="1" x="277" y="401" width="90" height="58" /> - <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" text-anchor="middle" x="322" y="413"><<interface>></text> - <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" font-weight="bold" text-anchor="middle" x="322" y="434">GLES2</text> - <line stroke="black" stroke-opacity="1" x1="277" y1="443" x2="367" y2="443" /> - <line stroke="black" stroke-opacity="1" x1="277" y1="451" x2="367" y2="451" /> -</g> -<g> - <rect fill="#808080" stroke="none" stroke-opacity="1" x="606" y="26" width="3" height="35" /> - <rect fill="#808080" stroke="none" stroke-opacity="1" x="538" y="58" width="71" height="3" /> - <rect fill="#ffffc0" stroke="black" stroke-width="1" stroke-opacity="1" x="534" y="22" width="72" height="36" /> - <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" font-weight="bold" font-style="italic" text-anchor="middle" x="570" y="34">GLContext</text> - <line stroke="black" stroke-opacity="1" x1="534" y1="43" x2="606" y2="43" /> - <line stroke="black" stroke-opacity="1" x1="534" y1="51" x2="606" y2="51" /> -</g> -<g> - <rect fill="#808080" stroke="none" stroke-opacity="1" x="748" y="120" width="3" height="35" /> - <rect fill="#808080" stroke="none" stroke-opacity="1" x="670" y="152" width="81" height="3" /> - <rect fill="#ffffc0" stroke="black" stroke-width="1" stroke-opacity="1" x="666" y="116" width="82" height="36" /> - <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" font-weight="bold" font-style="italic" text-anchor="middle" x="707" y="128">GLDrawable</text> - <line stroke="black" stroke-opacity="1" x1="666" y1="137" x2="748" y2="137" /> - <line stroke="black" stroke-opacity="1" x1="666" y1="145" x2="748" y2="145" /> -</g> -<g> - <line stroke="black" stroke-opacity="1" x1="239" y1="737" x2="259" y2="737" /> - <ellipse fill="#ffffc0" stroke="black" stroke-width="1" stroke-opacity="1" cx="249" cy="727" rx="10" ry="10" /> - <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" font-weight="bold" text-anchor="middle" x="249" y="749">GL2Impl</text> - <line stroke="black" stroke-opacity="1" x1="219" y1="758" x2="279" y2="758" /> - <line stroke="black" stroke-opacity="1" x1="219" y1="766" x2="279" y2="766" /> -</g> -<g> - <line stroke="black" stroke-opacity="1" x1="467" y1="737" x2="487" y2="737" /> - <ellipse fill="#ffffc0" stroke="black" stroke-width="1" stroke-opacity="1" cx="477" cy="727" rx="10" ry="10" /> - <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" font-weight="bold" text-anchor="middle" x="477" y="749">GL3Impl</text> - <line stroke="black" stroke-opacity="1" x1="447" y1="758" x2="507" y2="758" /> - <line stroke="black" stroke-opacity="1" x1="447" y1="766" x2="507" y2="766" /> -</g> -<g> - <line stroke="black" stroke-opacity="1" x1="313" y1="520" x2="333" y2="520" /> - <ellipse fill="#ffffc0" stroke="black" stroke-width="1" stroke-opacity="1" cx="323" cy="510" rx="10" ry="10" /> - <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" font-weight="bold" text-anchor="middle" x="323" y="532">GLES2Impl</text> - <line stroke="black" stroke-opacity="1" x1="284" y1="541" x2="362" y2="541" /> - <line stroke="black" stroke-opacity="1" x1="284" y1="549" x2="362" y2="549" /> -</g> - <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" x="544" y="655">Desktop final public</text> - <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" x="544" y="673">OpenGL Interfaces</text> - <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" x="544" y="440">Mobile final public</text> - <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" x="544" y="458">OpenGL Interfaces</text> - <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" x="26" y="754">Private implementation (detail)</text> - <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" x="544" y="264">Desktop/Mobile</text> - <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" x="544" y="282">Common Interfaces</text> -<g> - <rect fill="#808080" stroke="none" stroke-opacity="1" x="865" y="192" width="3" height="57" /> - <rect fill="#808080" stroke="none" stroke-opacity="1" x="773" y="246" width="95" height="3" /> - <rect fill="#ffffc0" stroke="black" stroke-width="1" stroke-opacity="1" x="769" y="188" width="96" height="58" /> - <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" text-anchor="middle" x="817" y="200"><<interface>></text> - <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" font-weight="bold" text-anchor="middle" x="817" y="221">NativeWindow</text> - <line stroke="black" stroke-opacity="1" x1="769" y1="230" x2="865" y2="230" /> - <line stroke="black" stroke-opacity="1" x1="769" y1="238" x2="865" y2="238" /> -</g> -<g> - <rect fill="#808080" stroke="none" stroke-opacity="1" x="917" y="292" width="3" height="35" /> - <rect fill="#808080" stroke="none" stroke-opacity="1" x="721" y="324" width="199" height="3" /> - <rect fill="#ffffc0" stroke="black" stroke-width="1" stroke-opacity="1" x="717" y="288" width="200" height="36" /> - <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" font-weight="bold" font-style="italic" text-anchor="middle" x="817" y="300">AbstractGraphicsConfiguration</text> - <line stroke="black" stroke-opacity="1" x1="717" y1="309" x2="917" y2="309" /> - <line stroke="black" stroke-opacity="1" x1="717" y1="317" x2="917" y2="317" /> -</g> -<g> - <rect fill="#808080" stroke="none" stroke-opacity="1" x="864" y="455" width="3" height="35" /> - <rect fill="#808080" stroke="none" stroke-opacity="1" x="770" y="487" width="97" height="3" /> - <rect fill="#ffffc0" stroke="black" stroke-width="1" stroke-opacity="1" x="766" y="451" width="98" height="36" /> - <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" font-weight="bold" text-anchor="middle" x="815" y="463">GLCapabilities</text> - <line stroke="black" stroke-opacity="1" x1="766" y1="472" x2="864" y2="472" /> - <line stroke="black" stroke-opacity="1" x1="766" y1="480" x2="864" y2="480" /> -</g> -<g> - <rect fill="#808080" stroke="none" stroke-opacity="1" x="849" y="536" width="3" height="35" /> - <rect fill="#808080" stroke="none" stroke-opacity="1" x="787" y="568" width="65" height="3" /> - <rect fill="#ffffc0" stroke="black" stroke-width="1" stroke-opacity="1" x="783" y="532" width="66" height="36" /> - <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" font-weight="bold" text-anchor="middle" x="816" y="544">GLProfile</text> - <line stroke="black" stroke-opacity="1" x1="783" y1="553" x2="849" y2="553" /> - <line stroke="black" stroke-opacity="1" x1="783" y1="561" x2="849" y2="561" /> -</g> - <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" x="784" y="33">Lifecycle: From the lower right to</text> - <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" x="784" y="51">the top, left step where the</text> - <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" x="784" y="69">GLContext is created with a</text> - <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" x="784" y="87">suitable GL implementation</text> - <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" x="784" y="105">matching the GLProfile.</text> -<g> - <rect fill="#808080" stroke="none" stroke-opacity="1" x="233" y="16" width="3" height="57" /> - <rect fill="#808080" stroke="none" stroke-opacity="1" x="147" y="70" width="89" height="3" /> - <rect fill="#ffffc0" stroke="black" stroke-width="1" stroke-opacity="1" x="143" y="12" width="90" height="58" /> - <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" text-anchor="middle" x="188" y="24"><<interface>></text> - <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" font-weight="bold" text-anchor="middle" x="188" y="45">GLBase</text> - <line stroke="black" stroke-opacity="1" x1="143" y1="54" x2="233" y2="54" /> - <line stroke="black" stroke-opacity="1" x1="143" y1="62" x2="233" y2="62" /> -</g> - <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" x="273" y="152">Common GL Stuff</text> -<g> - <rect fill="#808080" stroke="none" stroke-opacity="1" x="131" y="405" width="3" height="57" /> - <rect fill="#808080" stroke="none" stroke-opacity="1" x="45" y="459" width="89" height="3" /> - <rect fill="#ffffc0" stroke="black" stroke-width="1" stroke-opacity="1" x="41" y="401" width="90" height="58" /> - <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" text-anchor="middle" x="86" y="413"><<interface>></text> - <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" font-weight="bold" text-anchor="middle" x="86" y="434">GLES1</text> - <line stroke="black" stroke-opacity="1" x1="41" y1="443" x2="131" y2="443" /> - <line stroke="black" stroke-opacity="1" x1="41" y1="451" x2="131" y2="451" /> -</g> - <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" x="544" y="341">Common Desktop</text> - <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" x="544" y="359">Profile</text> -<g> - <rect fill="#808080" stroke="none" stroke-opacity="1" x="520" y="318" width="3" height="57" /> - <rect fill="#808080" stroke="none" stroke-opacity="1" x="434" y="372" width="89" height="3" /> - <rect fill="#ffffc0" stroke="black" stroke-width="1" stroke-opacity="1" x="430" y="314" width="90" height="58" /> - <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" text-anchor="middle" x="475" y="326"><<interface>></text> - <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" font-weight="bold" text-anchor="middle" x="475" y="347">GL2GL3</text> - <line stroke="black" stroke-opacity="1" x1="430" y1="356" x2="520" y2="356" /> - <line stroke="black" stroke-opacity="1" x1="430" y1="364" x2="520" y2="364" /> -</g> -<g> - <line stroke="black" stroke-opacity="1" x1="78" y1="520" x2="98" y2="520" /> - <ellipse fill="#ffffc0" stroke="black" stroke-width="1" stroke-opacity="1" cx="88" cy="510" rx="10" ry="10" /> - <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" font-weight="bold" text-anchor="middle" x="88" y="532">GLES1Impl</text> - <line stroke="black" stroke-opacity="1" x1="49" y1="541" x2="127" y2="541" /> - <line stroke="black" stroke-opacity="1" x1="49" y1="549" x2="127" y2="549" /> -</g> -<g> - <rect fill="#808080" stroke="none" stroke-opacity="1" x="856" y="387" width="3" height="35" /> - <rect fill="#808080" stroke="none" stroke-opacity="1" x="780" y="419" width="79" height="3" /> - <rect fill="#ffffc0" stroke="black" stroke-width="1" stroke-opacity="1" x="776" y="383" width="80" height="36" /> - <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" font-weight="bold" text-anchor="middle" x="816" y="395">Capabilities</text> - <line stroke="black" stroke-opacity="1" x1="776" y1="404" x2="856" y2="404" /> - <line stroke="black" stroke-opacity="1" x1="776" y1="412" x2="856" y2="412" /> -</g> -<g> - <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" x="585" y="76">0..1</text> -</g> -<g> - <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" x="652" y="116">1</text> -</g> -<g> - <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" x="794" y="370">chosen</text> -</g> -<g> - <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" x="767" y="370">1</text> -</g> -<g> - <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" x="861" y="370">requested</text> -</g> -<g> - <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" x="834" y="370">1</text> -</g> -<g> - <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" x="516" y="60">1</text> -</g> -<g> - <text font-family="Helvetica" font-size="10" fill="#000000" xml:space="preserve" x="247" y="60">1</text> -</g> -</svg> diff --git a/doc/bouml/html/index-withframe.html b/doc/bouml/html/index-withframe.html index 0be7077fc..2410daaaf 100644 --- a/doc/bouml/html/index-withframe.html +++ b/doc/bouml/html/index-withframe.html @@ -4,7 +4,7 @@ <html xmlns="http://www.w3.org/1999/xhtml"> <head> -<title>/net/jordan/usr/local/projects/SUN/JOGL/jogl/doc/bouml/html/index-withframe</title> +<title>/usr/local/projects/JOGL/jogl/doc/bouml/html/index-withframe</title> <link rel="stylesheet" href="style.css" type="text/css" /> </head> <FRAMESET cols="20%,80%"> diff --git a/doc/bouml/html/index.html b/doc/bouml/html/index.html index 4d8af75e6..952c4518b 100644 --- a/doc/bouml/html/index.html +++ b/doc/bouml/html/index.html @@ -18,7 +18,7 @@ Documentation</title> <a name="refpackage129"></a> <p>Properties:<ul> -<li>html dir:<br /><div class="sub">/net/jordan/usr/local/projects/SUN/JOGL/jogl/doc/bouml/html/</div></p></li> +<li>html dir:<br /><div class="sub">/usr/local/projects/JOGL/jogl/doc/bouml/html/</div></p></li> </ul></p> <a name="refclass view128069"></a> <h1 class ="view">1 Class View javax.media.opengl</h1> @@ -38,7 +38,7 @@ Documentation</title> <a name="refclass128197"></a> <h2 class ="class">1.2 Class GL2ES1</h2> <p>Declaration :</p><ul> -<li>Java : public interface GL2ES1 extends <a href="index.html#refclass128069"><b>GL</b></a> </li><li>Php : public interface GL2ES1 </li></ul><p>Directly inherited by : <a href="index.html#refclass128453"><b>GL2</b></a> <a href="index.html#refclass128325"><b>GLES1</b></a> </p> +<li>Java : public interface GL2ES1 extends <a href="index.html#refclass128069"><b>GL</b></a> </li><li>Php : public interface GL2ES1 </li></ul><p>Directly inherited by : <a href="index.html#refclass128453"><b>GL2</b></a> <a href="index.html#refclass128386"><b>GL2ES12</b></a> <a href="index.html#refclass128325"><b>GLES1</b></a> </p> <p>Stereotype: interface</p> <div class="sub"> <div class="sub"> @@ -56,7 +56,7 @@ Documentation</title> <a name="refclass128453"></a> <h2 class ="class">1.4 Class GL2</h2> <p>Declaration :</p><ul> -<li>Java : public interface GL2 extends <a href="index.html#refclass128709"><b>GL2GL3</b></a> </li><li>Php : public interface GL2 </li></ul><p>Directly inherited by : <a href="index.html#refclass130373"><b>GL2Impl</b></a> </p> +<li>Java : public interface GL2 extends <a href="index.html#refclass128709"><b>GL2GL3</b></a> </li><li>Php : public interface GL2 </li></ul><p>Directly inherited by : <a href="index.html#refclass128002"><b>GL3bc</b></a> <a href="index.html#refclass130501"><b>GL4bcImpl</b></a> </p> <p>Stereotype: interface</p> <div class="sub"> <div class="sub"> @@ -65,7 +65,7 @@ Documentation</title> <a name="refclass128581"></a> <h2 class ="class">1.5 Class GL2ES2</h2> <p>Declaration :</p><ul> -<li>Java : public interface GL2ES2 extends <a href="index.html#refclass128069"><b>GL</b></a> </li><li>Php : public interface GL2ES2 </li></ul><p>Directly inherited by : <a href="index.html#refclass128709"><b>GL2GL3</b></a> <a href="index.html#refclass128965"><b>GLES2</b></a> </p> +<li>Java : public interface GL2ES2 extends <a href="index.html#refclass128069"><b>GL</b></a> </li><li>Php : public interface GL2ES2 </li></ul><p>Directly inherited by : <a href="index.html#refclass128386"><b>GL2ES12</b></a> <a href="index.html#refclass128709"><b>GL2GL3</b></a> <a href="index.html#refclass128965"><b>GLES2</b></a> </p> <p>Stereotype: interface</p> <div class="sub"> <div class="sub"> @@ -83,7 +83,7 @@ Documentation</title> <a name="refclass128837"></a> <h2 class ="class">1.7 Class GL3</h2> <p>Declaration :</p><ul> -<li>Java : public interface GL3 extends <a href="index.html#refclass128709"><b>GL2GL3</b></a> </li><li>Php : public interface GL3 </li></ul><p>Directly inherited by : <a href="index.html#refclass130501"><b>GL3Impl</b></a> </p> +<li>Java : public interface GL3 extends <a href="index.html#refclass128709"><b>GL2GL3</b></a> </li><li>Php : public interface GL3 </li></ul><p>Directly inherited by : <a href="index.html#refclass128002"><b>GL3bc</b></a> <a href="index.html#refclass128130"><b>GL4</b></a> <a href="index.html#refclass130501"><b>GL4bcImpl</b></a> </p> <p>Stereotype: interface</p> <div class="sub"> <div class="sub"> @@ -116,24 +116,16 @@ Documentation</title> <table><tr><td><div class="element">Relation <b><association></b></div></td></tr></table><p>Declaration :</p><ul><li>Uml : - : <a href="index.html#refclass130117"><b>GLContext</b></a>, multiplicity : 0..1</li><li>Java : private <a href="index.html#refclass130117"><b>GLContext</b></a> </li></ul><a name="refrelation132421"></a> <table><tr><td><div class="element">Relation <b><association></b></div></td></tr></table><p>Declaration :</p><ul><li>Uml : - : <a href="index.html#refclass130885"><b>NativeWindow</b></a></li><li>Java : private <a href="index.html#refclass130885"><b>NativeWindow</b></a> </li></ul></div> </div> -<a name="refclass130373"></a> -<h2 class ="class">1.11 Class GL2Impl</h2> -<p>Declaration :</p><ul> -<li>Java : private class GL2Impl implements <a href="index.html#refclass128453"><b>GL2</b></a> </li></ul><p>Stereotype: entity</p> -<div class="sub"> -<div class="sub"> -</div> -</div> <a name="refclass130501"></a> -<h2 class ="class">1.12 Class GL3Impl</h2> +<h2 class ="class">1.11 Class GL4bcImpl</h2> <p>Declaration :</p><ul> -<li>Java : private class GL3Impl implements <a href="index.html#refclass128837"><b>GL3</b></a> </li></ul><p>Stereotype: entity</p> +<li>Java : private class GL4bcImpl implements <a href="index.html#refclass128837"><b>GL3</b></a>, <a href="index.html#refclass128002"><b>GL3bc</b></a>, <a href="index.html#refclass128258"><b>GL4bc</b></a>, <a href="index.html#refclass128453"><b>GL2</b></a>, <a href="index.html#refclass128130"><b>GL4</b></a> </li></ul><p>Stereotype: entity</p> <div class="sub"> <div class="sub"> </div> </div> <a name="refclass130629"></a> -<h2 class ="class">1.13 Class GLES2Impl</h2> +<h2 class ="class">1.12 Class GLES2Impl</h2> <p>Declaration :</p><ul> <li>Java : private class GLES2Impl implements <a href="index.html#refclass128965"><b>GLES2</b></a> </li></ul><p>Stereotype: entity</p> <div class="sub"> @@ -141,7 +133,7 @@ Documentation</title> </div> </div> <a name="refclass130757"></a> -<h2 class ="class">1.14 Class GLES1Impl</h2> +<h2 class ="class">1.13 Class GLES1Impl</h2> <p>Declaration :</p><ul> <li>Java : private class GLES1Impl implements <a href="index.html#refclass128325"><b>GLES1</b></a> </li></ul><p>Stereotype: entity</p> <div class="sub"> @@ -149,7 +141,7 @@ Documentation</title> </div> </div> <a name="refclass130885"></a> -<h2 class ="class">1.15 Class NativeWindow</h2> +<h2 class ="class">1.14 Class NativeWindow</h2> <p>Declaration :</p><ul> <li>Java : package interface NativeWindow </li><li>Php : interface NativeWindow </li></ul><p>Stereotype: interface</p> <div class="sub"> @@ -159,7 +151,7 @@ Documentation</title> <table><tr><td><div class="element">Relation <b><association></b></div></td></tr></table><p>Declaration :</p><ul><li>Uml : - : <a href="index.html#refclass130245"><b>GLDrawable</b></a></li><li>Java : private <a href="index.html#refclass130245"><b>GLDrawable</b></a> </li></ul></div> </div> <a name="refclass131013"></a> -<h2 class ="class">1.16 Class AbstractGraphicsConfiguration</h2> +<h2 class ="class">1.15 Class AbstractGraphicsConfiguration</h2> <p>Declaration :</p><ul> <li>Java : package abstract class AbstractGraphicsConfiguration </li></ul><div class="sub"> <div class="sub"> @@ -169,7 +161,7 @@ Documentation</title> <table><tr><td><div class="element">Relation <b><association></b></div></td></tr></table><p>Declaration :</p><ul><li>Uml : - : <a href="index.html#refclass130885"><b>NativeWindow</b></a></li><li>Java : private <a href="index.html#refclass130885"><b>NativeWindow</b></a> </li></ul></div> </div> <a name="refclass131141"></a> -<h2 class ="class">1.17 Class GLCapabilities</h2> +<h2 class ="class">1.16 Class GLCapabilities</h2> <p>Declaration :</p><ul> <li>Java : package class GLCapabilities extends <a href="index.html#refclass131269"><b>Capabilities</b></a> </li></ul><div class="sub"> <div class="sub"> @@ -178,7 +170,7 @@ Documentation</title> <table><tr><td><div class="element">Relation <b><association></b></div></td></tr></table><p>Declaration :</p><ul><li>Uml : - : <a href="index.html#refclass131397"><b>GLProfile</b></a></li><li>Java : private <a href="index.html#refclass131397"><b>GLProfile</b></a> </li></ul></div> </div> <a name="refclass131269"></a> -<h2 class ="class">1.18 Class Capabilities</h2> +<h2 class ="class">1.17 Class Capabilities</h2> <p>Declaration :</p><ul> <li>Java : package class Capabilities </li></ul><p>Directly inherited by : <a href="index.html#refclass131141"><b>GLCapabilities</b></a> </p> <div class="sub"> @@ -188,7 +180,7 @@ Documentation</title> <table><tr><td><div class="element">Relation <b><association></b></div></td></tr></table><p>Declaration :</p><ul><li>Uml : - : <a href="index.html#refclass131013"><b>AbstractGraphicsConfiguration</b></a></li><li>Java : private <a href="index.html#refclass131013"><b>AbstractGraphicsConfiguration</b></a> </li></ul></div> </div> <a name="refclass131397"></a> -<h2 class ="class">1.19 Class GLProfile</h2> +<h2 class ="class">1.18 Class GLProfile</h2> <p>Declaration :</p><ul> <li>Java : package class GLProfile </li></ul><div class="sub"> <div class="sub"> @@ -197,7 +189,7 @@ Documentation</title> <table><tr><td><div class="element">Relation <b><association></b></div></td></tr></table><p>Declaration :</p><ul><li>Uml : - : <a href="index.html#refclass131141"><b>GLCapabilities</b></a></li><li>Java : private <a href="index.html#refclass131141"><b>GLCapabilities</b></a> </li></ul></div> </div> <a name="refclass132549"></a> -<h2 class ="class">1.20 Class GLBase</h2> +<h2 class ="class">1.19 Class GLBase</h2> <p>Declaration :</p><ul> <li>Java : public interface GLBase </li><li>Php : public interface GLBase </li></ul><p>Directly inherited by : <a href="index.html#refclass128069"><b>GL</b></a> </p> <p>Stereotype: interface</p> @@ -206,6 +198,41 @@ Documentation</title> <a name="refrelation134213"></a> <table><tr><td><div class="element">Relation <b><association></b></div></td></tr></table><p>Declaration :</p><ul><li>Uml : - : <a href="index.html#refclass130117"><b>GLContext</b></a>, multiplicity : 1</li><li>Java : private <a href="index.html#refclass130117"><b>GLContext</b></a> </li></ul></div> </div> +<a name="refclass128002"></a> +<h2 class ="class">1.20 Class GL3bc</h2> +<p>Declaration :</p><ul> +<li>Java : package interface GL3bc extends <a href="index.html#refclass128453"><b>GL2</b></a> </li><li>Php : interface GL3bc </li></ul><p>Directly inherited by : <a href="index.html#refclass128258"><b>GL4bc</b></a> <a href="index.html#refclass130501"><b>GL4bcImpl</b></a> </p> +<p>Stereotype: interface</p> +<div class="sub"> +<div class="sub"> +</div> +</div> +<a name="refclass128130"></a> +<h2 class ="class">1.21 Class GL4</h2> +<p>Declaration :</p><ul> +<li>Java : package interface GL4 extends <a href="index.html#refclass128837"><b>GL3</b></a> </li><li>Php : interface GL4 </li></ul><p>Directly inherited by : <a href="index.html#refclass128258"><b>GL4bc</b></a> <a href="index.html#refclass130501"><b>GL4bcImpl</b></a> </p> +<p>Stereotype: interface</p> +<div class="sub"> +<div class="sub"> +</div> +</div> +<a name="refclass128258"></a> +<h2 class ="class">1.22 Class GL4bc</h2> +<p>Declaration :</p><ul> +<li>Java : package interface GL4bc extends <a href="index.html#refclass128002"><b>GL3bc</b></a> </li><li>Php : interface GL4bc </li></ul><p>Directly inherited by : <a href="index.html#refclass130501"><b>GL4bcImpl</b></a> </p> +<p>Stereotype: interface</p> +<div class="sub"> +<div class="sub"> +</div> +</div> +<a name="refclass128386"></a> +<h2 class ="class">1.23 Class GL2ES12</h2> +<p>Declaration :</p><ul> +<li>Java : package class GL2ES12 implements <a href="index.html#refclass128197"><b>GL2ES1</b></a>, <a href="index.html#refclass128581"><b>GL2ES2</b></a> </li></ul><p>Stereotype: entity</p> +<div class="sub"> +<div class="sub"> +</div> +</div> </div> </body> </html> diff --git a/doc/bouml/html/index_71.html b/doc/bouml/html/index_71.html index dc1a0a051..9481c2466 100644 --- a/doc/bouml/html/index_71.html +++ b/doc/bouml/html/index_71.html @@ -20,11 +20,14 @@ <tr bgcolor=#f0f0f0><td><a href="index.html#refclass128069" target = "projectFrame"><b>GL</b></a></td><td>class</td><td></td></tr> <tr bgcolor=#f0f0f0><td><a href="index.html#refclass128453" target = "projectFrame"><b>GL2</b></a></td><td>class</td><td></td></tr> <tr bgcolor=#f0f0f0><td><a href="index.html#refclass128197" target = "projectFrame"><b>GL2ES1</b></a></td><td>class</td><td></td></tr> +<tr bgcolor=#f0f0f0><td><a href="index.html#refclass128386" target = "projectFrame"><b>GL2ES12</b></a></td><td>class</td><td></td></tr> <tr bgcolor=#f0f0f0><td><a href="index.html#refclass128581" target = "projectFrame"><b>GL2ES2</b></a></td><td>class</td><td></td></tr> <tr bgcolor=#f0f0f0><td><a href="index.html#refclass128709" target = "projectFrame"><b>GL2GL3</b></a></td><td>class</td><td></td></tr> -<tr bgcolor=#f0f0f0><td><a href="index.html#refclass130373" target = "projectFrame"><b>GL2Impl</b></a></td><td>class</td><td></td></tr> <tr bgcolor=#f0f0f0><td><a href="index.html#refclass128837" target = "projectFrame"><b>GL3</b></a></td><td>class</td><td></td></tr> -<tr bgcolor=#f0f0f0><td><a href="index.html#refclass130501" target = "projectFrame"><b>GL3Impl</b></a></td><td>class</td><td></td></tr> +<tr bgcolor=#f0f0f0><td><a href="index.html#refclass128002" target = "projectFrame"><b>GL3bc</b></a></td><td>class</td><td></td></tr> +<tr bgcolor=#f0f0f0><td><a href="index.html#refclass128130" target = "projectFrame"><b>GL4</b></a></td><td>class</td><td></td></tr> +<tr bgcolor=#f0f0f0><td><a href="index.html#refclass128258" target = "projectFrame"><b>GL4bc</b></a></td><td>class</td><td></td></tr> +<tr bgcolor=#f0f0f0><td><a href="index.html#refclass130501" target = "projectFrame"><b>GL4bcImpl</b></a></td><td>class</td><td></td></tr> <tr bgcolor=#f0f0f0><td><a href="index.html#refclass132549" target = "projectFrame"><b>GLBase</b></a></td><td>class</td><td></td></tr> <tr bgcolor=#f0f0f0><td><a href="index.html#refclass131141" target = "projectFrame"><b>GLCapabilities</b></a></td><td>class</td><td></td></tr> <tr bgcolor=#f0f0f0><td><a href="index.html#refclass130117" target = "projectFrame"><b>GLContext</b></a></td><td>class</td><td></td></tr> diff --git a/doc/bouml/html/navig.html b/doc/bouml/html/navig.html index 5cbd746bd..16236c7b5 100644 --- a/doc/bouml/html/navig.html +++ b/doc/bouml/html/navig.html @@ -4,7 +4,7 @@ <html xmlns="http://www.w3.org/1999/xhtml"> <head> -<title>/net/jordan/usr/local/projects/SUN/JOGL/jogl/doc/bouml/html/navig</title> +<title>/usr/local/projects/JOGL/jogl/doc/bouml/html/navig</title> <link rel="stylesheet" href="style.css" type="text/css" /> </head> <body bgcolor="#ffffff"> diff --git a/doc/bouml/jogl/128069.diagram b/doc/bouml/jogl/128069.diagram index d467ebad4..41c5df023 100644 --- a/doc/bouml/jogl/128069.diagram +++ b/doc/bouml/jogl/128069.diagram @@ -1,20 +1,32 @@ -format 62 +format 67 +classcanvas 128002 class_ref 128002 // GL3bc + draw_all_relations default hide_attributes default hide_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_multiplicity default show_members_initialization default show_attribute_modifiers default member_max_width 0 show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_relation_modifiers default show_infonote default shadow default show_stereotype_properties default + xyz 197 761 2000 +end classcanvas 128069 class_ref 128069 // GL draw_all_relations default hide_attributes default hide_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_multiplicity default show_members_initialization default show_attribute_modifiers default member_max_width 0 show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_relation_modifiers default show_infonote default shadow default show_stereotype_properties default xyz 142 112 2000 end +classcanvas 128130 class_ref 128130 // GL4 + draw_all_relations default hide_attributes default hide_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_multiplicity default show_members_initialization default show_attribute_modifiers default member_max_width 0 show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_relation_modifiers default show_infonote default shadow default show_stereotype_properties default + xyz 491 844 2000 +end classcanvas 128197 class_ref 128197 // GL2ES1 draw_all_relations default hide_attributes default hide_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_multiplicity default show_members_initialization default show_attribute_modifiers default member_max_width 0 show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_relation_modifiers default show_infonote default shadow default show_stereotype_properties default xyz 42 226 2000 end +classcanvas 128258 class_ref 128258 // GL4bc + draw_all_relations default hide_attributes default hide_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_multiplicity default show_members_initialization default show_attribute_modifiers default member_max_width 0 show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_relation_modifiers default show_infonote default shadow default show_stereotype_properties default + xyz 197 905 2000 +end classcanvas 128325 class_ref 128325 // GLES1 draw_all_relations default hide_attributes default hide_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_multiplicity default show_members_initialization default show_attribute_modifiers default member_max_width 0 show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_relation_modifiers default show_infonote default shadow default show_stereotype_properties default xyz 41 401 2000 end classcanvas 128453 class_ref 128453 // GL2 draw_all_relations default hide_attributes default hide_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_multiplicity default show_members_initialization default show_attribute_modifiers default member_max_width 0 show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_relation_modifiers default show_infonote default shadow default show_stereotype_properties default - xyz 202 625 2000 + xyz 199 615 2000 end classcanvas 128581 class_ref 128581 // GL2ES2 draw_all_relations default hide_attributes default hide_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_multiplicity default show_members_initialization default show_attribute_modifiers default member_max_width 0 show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_relation_modifiers default show_infonote default shadow default show_stereotype_properties default @@ -22,16 +34,20 @@ classcanvas 128581 class_ref 128581 // GL2ES2 end classcanvas 128709 class_ref 128709 // GL2GL3 draw_all_relations default hide_attributes default hide_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_multiplicity default show_members_initialization default show_attribute_modifiers default member_max_width 0 show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_relation_modifiers default show_infonote default shadow default show_stereotype_properties default - xyz 430 314 2005 + xyz 493 316 2005 end classcanvas 128837 class_ref 128837 // GL3 draw_all_relations default hide_attributes default hide_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_multiplicity default show_members_initialization default show_attribute_modifiers default member_max_width 0 show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_relation_modifiers default show_infonote default shadow default show_stereotype_properties default - xyz 429 625 2000 + xyz 492 684 2000 end classcanvas 128965 class_ref 128965 // GLES2 draw_all_relations default hide_attributes default hide_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_multiplicity default show_members_initialization default show_attribute_modifiers default member_max_width 0 show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_relation_modifiers default show_infonote default shadow default show_stereotype_properties default xyz 277 401 2000 end +classcanvas 129666 class_ref 128386 // GL2ES12 + draw_all_relations default hide_attributes default hide_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_multiplicity default show_members_initialization default show_attribute_modifiers default member_max_width 0 show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_relation_modifiers default show_infonote default shadow default show_stereotype_properties default + xyz 184 288 2000 +end classcanvas 130245 class_ref 130117 // GLContext draw_all_relations default hide_attributes default hide_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_multiplicity default show_members_initialization default show_attribute_modifiers default member_max_width 0 show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_relation_modifiers default show_infonote default shadow default show_stereotype_properties default xyz 534 22 2000 @@ -40,50 +56,46 @@ classcanvas 130501 class_ref 130245 // GLDrawable draw_all_relations default hide_attributes default hide_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_multiplicity default show_members_initialization default show_attribute_modifiers default member_max_width 0 show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_relation_modifiers default show_infonote default shadow default show_stereotype_properties default xyz 666 116 2000 end -classcanvas 130757 class_ref 130373 // GL2Impl - draw_all_relations default hide_attributes default hide_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_multiplicity default show_members_initialization default show_attribute_modifiers default member_max_width 0 show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_relation_modifiers default show_infonote default shadow default show_stereotype_properties default - xyz 219 717 2000 -end -classcanvas 130885 class_ref 130501 // GL3Impl +classcanvas 130885 class_ref 130501 // GL4bcImpl draw_all_relations default hide_attributes default hide_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_multiplicity default show_members_initialization default show_attribute_modifiers default member_max_width 0 show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_relation_modifiers default show_infonote default shadow default show_stereotype_properties default - xyz 447 717 2000 + xyz 361 1048 2000 end classcanvas 131013 class_ref 130629 // GLES2Impl draw_all_relations default hide_attributes default hide_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_multiplicity default show_members_initialization default show_attribute_modifiers default member_max_width 0 show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_relation_modifiers default show_infonote default shadow default show_stereotype_properties default - xyz 284 500 2000 + xyz 284 491 2000 end classcanvas 131141 class_ref 130757 // GLES1Impl draw_all_relations default hide_attributes default hide_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_multiplicity default show_members_initialization default show_attribute_modifiers default member_max_width 0 show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_relation_modifiers default show_infonote default shadow default show_stereotype_properties default - xyz 49 500 2005 + xyz 47 484 2005 end textcanvas 131781 "Desktop final public OpenGL Interfaces " - xyzwh 544 638 2000 135 37 + xyzwh 605 636 2000 135 37 textcanvas 131909 "Mobile final public OpenGL Interfaces" - xyzwh 544 423 2000 125 38 + xyzwh 607 427 2000 125 38 textcanvas 132037 "Private implementation (detail)" - xyzwh 26 737 2000 179 17 + xyzwh 20 1073 2000 178 18 textcanvas 132165 "Desktop/Mobile Common Interfaces" - xyzwh 544 247 2000 129 42 + xyzwh 606 244 2000 129 42 classcanvas 132293 class_ref 130885 // NativeWindow draw_all_relations default hide_attributes default hide_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_multiplicity default show_members_initialization default show_attribute_modifiers default member_max_width 0 show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_relation_modifiers default show_infonote default shadow default show_stereotype_properties default - xyz 769 188 2000 + xyz 800 204 2000 end classcanvas 132421 class_ref 131013 // AbstractGraphicsConfiguration draw_all_relations default hide_attributes default hide_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_multiplicity default show_members_initialization default show_attribute_modifiers default member_max_width 0 show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_relation_modifiers default show_infonote default shadow default show_stereotype_properties default - xyz 717 288 2000 + xyz 748 304 2000 end classcanvas 132549 class_ref 131141 // GLCapabilities draw_all_relations default hide_attributes default hide_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_multiplicity default show_members_initialization default show_attribute_modifiers default member_max_width 0 show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_relation_modifiers default show_infonote default shadow default show_stereotype_properties default - xyz 766 451 2000 + xyz 797 467 2000 end classcanvas 132677 class_ref 131269 // Capabilities draw_all_relations default hide_attributes default hide_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_multiplicity default show_members_initialization default show_attribute_modifiers default member_max_width 0 show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_relation_modifiers default show_infonote default shadow default show_stereotype_properties default - xyz 776 383 2005 + xyz 807 399 2005 end classcanvas 132805 class_ref 131397 // GLProfile draw_all_relations default hide_attributes default hide_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_multiplicity default show_members_initialization default show_attribute_modifiers default member_max_width 0 show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_relation_modifiers default show_infonote default shadow default show_stereotype_properties default - xyz 783 532 2000 + xyz 814 548 2000 end textcanvas 135749 "Lifecycle: From the lower right to the top, left step where the GLContext is created with a suitable GL implementation matching the GLProfile." xyzwh 784 16 2000 208 93 @@ -94,34 +106,79 @@ end textcanvas 136261 "Common GL Stuff" xyzwh 273 135 2000 108 17 fragment 136517 "Programmable Shader" - color blue xyzwh 238 193 1994 448 610 - separator 3275 - separator 6177 - separator 1832 + color blue xyzwh 238 195 1994 506 974 + separator 2053 + separator 3866 + separator 1144 end fragment 136645 "Fixed Function" - color lightgray xyzwh 5 193 1989 235 610 - separator 3278 - separator 6177 - separator 1821 + color lightgray xyzwh 2 195 1989 238 973 + separator 2035 + separator 3866 + separator 1143 end textcanvas 136773 "Common Desktop Profile" - xyzwh 544 324 2000 115 39 + xyzwh 606 329 2000 115 39 +relationcanvas 128386 relation_ref 128002 // <realization> + from ref 130885 z 2001 to ref 128002 + no_role_a no_role_b + no_multiplicity_a no_multiplicity_b +end +relationcanvas 128514 relation_ref 128130 // <realization> + from ref 130885 z 2001 to ref 128258 + no_role_a no_role_b + no_multiplicity_a no_multiplicity_b +end +relationcanvas 128642 relation_ref 128258 // <realization> + from ref 130885 z 2001 to ref 128453 + no_role_a no_role_b + no_multiplicity_a no_multiplicity_b +end +relationcanvas 128770 relation_ref 128386 // <realization> + from ref 130885 z 2001 to ref 128130 + no_role_a no_role_b + no_multiplicity_a no_multiplicity_b +end +relationcanvas 128898 relation_ref 128514 // <generalisation> + from ref 128002 z 2001 to ref 128453 + no_role_a no_role_b + no_multiplicity_a no_multiplicity_b +end +relationcanvas 129026 relation_ref 128642 // <generalisation> + from ref 128002 z 2001 to ref 128837 + no_role_a no_role_b + no_multiplicity_a no_multiplicity_b +end relationcanvas 129093 relation_ref 129221 // <generalisation> from ref 128197 z 1999 to ref 128069 no_role_a no_role_b no_multiplicity_a no_multiplicity_b end +relationcanvas 129154 relation_ref 128770 // <generalisation> + from ref 128130 z 2001 to ref 128837 + no_role_a no_role_b + no_multiplicity_a no_multiplicity_b +end relationcanvas 129221 relation_ref 129349 // <generalisation> from ref 128581 z 1999 to ref 128069 no_role_a no_role_b no_multiplicity_a no_multiplicity_b end +relationcanvas 129282 relation_ref 128898 // <generalisation> + from ref 128258 z 2001 to ref 128002 + no_role_a no_role_b + no_multiplicity_a no_multiplicity_b +end relationcanvas 129349 relation_ref 129477 // <generalisation> from ref 128325 z 1999 to ref 128197 no_role_a no_role_b no_multiplicity_a no_multiplicity_b end +relationcanvas 129410 relation_ref 129026 // <generalisation> + from ref 128258 z 2001 to ref 128130 + no_role_a no_role_b + no_multiplicity_a no_multiplicity_b +end relationcanvas 129477 relation_ref 129605 // <generalisation> from ref 128965 z 1999 to ref 128581 no_role_a no_role_b @@ -132,11 +189,21 @@ relationcanvas 129733 relation_ref 129861 // <generalisation> no_role_a no_role_b no_multiplicity_a no_multiplicity_b end +relationcanvas 129794 relation_ref 129154 // <realization> + from ref 129666 z 2001 to ref 128197 + no_role_a no_role_b + no_multiplicity_a no_multiplicity_b +end relationcanvas 129861 relation_ref 129989 // <generalisation> from ref 128453 z 1999 to ref 128709 no_role_a no_role_b no_multiplicity_a no_multiplicity_b end +relationcanvas 129922 relation_ref 129282 // <realization> + from ref 129666 z 2001 to ref 128581 + no_role_a no_role_b + no_multiplicity_a no_multiplicity_b +end relationcanvas 129989 relation_ref 130117 // <generalisation> from ref 128709 z 1999 to ref 128581 no_role_a no_role_b @@ -167,11 +234,6 @@ relationcanvas 131525 relation_ref 130885 // <realization> no_role_a no_role_b no_multiplicity_a no_multiplicity_b end -relationcanvas 131653 relation_ref 131013 // <realization> - from ref 130757 z 1999 to ref 128453 - no_role_a no_role_b - no_multiplicity_a no_multiplicity_b -end relationcanvas 132933 relation_ref 131141 // <generalisation> from ref 132549 z 1999 to ref 132677 no_role_a no_role_b @@ -181,8 +243,8 @@ relationcanvas 133061 relation_ref 131269 // <association> decenter_begin 331 decenter_end 105 from ref 132421 z 1999 to ref 132677 - role_a_pos 794 360 3000 no_role_b - multiplicity_a_pos 767 360 3000 no_multiplicity_b + role_a_pos 825 376 3000 no_role_b + multiplicity_a_pos 798 376 3000 no_multiplicity_b end relationcanvas 133701 relation_ref 131525 // <association> from ref 132421 z 1999 to ref 132293 @@ -203,8 +265,8 @@ relationcanvas 134213 relation_ref 131397 // <association> decenter_begin 894 decenter_end 658 from ref 132677 z 1999 to ref 132421 - no_role_a role_b_pos 861 360 3000 - no_multiplicity_a multiplicity_b_pos 834 360 3000 + no_role_a role_b_pos 892 376 3000 + no_multiplicity_a multiplicity_b_pos 865 376 3000 end relationcanvas 134725 relation_ref 131781 // <association> from ref 132805 z 1999 to ref 132549 diff --git a/doc/bouml/jogl/2.session b/doc/bouml/jogl/2.session new file mode 100644 index 000000000..35dd532b9 --- /dev/null +++ b/doc/bouml/jogl/2.session @@ -0,0 +1,11 @@ +window_sizes 1800 1053 450 1344 854 120 +diagrams + active classdiagram_ref 128069 // OpenGL Interfaces + 1344 854 100 17 0 0 +end +show_stereotypes +selected classdiagram_ref 128069 // OpenGL Interfaces +open + classview_ref 128069 // javax.media.opengl +end +end diff --git a/doc/bouml/jogl/jogl.prj b/doc/bouml/jogl/jogl.prj index 532267ccf..607638cc2 100644 --- a/doc/bouml/jogl/jogl.prj +++ b/doc/bouml/jogl/jogl.prj @@ -1,7 +1,7 @@ format 67 "jogl" - revision 5 - modified_by 69 "sg215889" + revision 7 + modified_by 2 "sven" @@ -37,7 +37,7 @@ format 67 mark_for_import ncouples 1 - key "html dir" value "/net/jordan/usr/local/projects/SUN/JOGL/jogl/doc/bouml/html/" + key "html dir" value "/usr/local/projects/JOGL/jogl/doc/bouml/html/" classview 128069 "javax.media.opengl" //class diagram settings draw_all_relations default hide_attributes default hide_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_multiplicity default show_members_initialization default show_attribute_modifiers default member_max_width 0 show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_relation_modifiers default show_infonote default shadow default show_stereotype_properties default @@ -56,7 +56,7 @@ format 67 show_infonote default drawing_language default show_stereotype_properties default classdiagram 128069 "OpenGL Interfaces" draw_all_relations default hide_attributes default hide_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_multiplicity default show_members_initialization default show_attribute_modifiers default member_max_width 0 show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_relation_modifiers default show_infonote default shadow default show_stereotype_properties default - size A4-Landscape + size A3-Landscape end class 128069 "GL" @@ -307,7 +307,7 @@ ${members}} end end - class 130373 "GL2Impl" + class 130501 "GL4bcImpl" visibility private stereotype "entity" cpp_decl "" java_decl "${comment}${@}${visibility}${final}${abstract}class ${name}${extends}${implements} { @@ -318,32 +318,44 @@ ${members}} idl_decl "" explicit_switch_type "" - classrelation 131269 // <realization> - relation 131013 -_-|> + classrelation 131141 // <realization> + relation 130885 -_-|> + a public + java "${type}" + classrelation_ref 131141 // <realization> + b parent class_ref 128837 // GL3 + end + + classrelation 128002 // <realization> + relation 128002 -_-|> + a public + java "${type}" + classrelation_ref 128002 // <realization> + b parent class_ref 128002 // GL3bc + end + + classrelation 128130 // <realization> + relation 128130 -_-|> + a public + java "${type}" + classrelation_ref 128130 // <realization> + b parent class_ref 128258 // GL4bc + end + + classrelation 128258 // <realization> + relation 128258 -_-|> a public java "${type}" - classrelation_ref 131269 // <realization> + classrelation_ref 128258 // <realization> b parent class_ref 128453 // GL2 end - end - class 130501 "GL3Impl" - visibility private stereotype "entity" - cpp_decl "" - java_decl "${comment}${@}${visibility}${final}${abstract}class ${name}${extends}${implements} { -${members}} -" - php_decl "" - python_2_2 python_decl "" - idl_decl "" - explicit_switch_type "" - - classrelation 131141 // <realization> - relation 130885 -_-|> + classrelation 128386 // <realization> + relation 128386 -_-|> a public java "${type}" - classrelation_ref 131141 // <realization> - b parent class_ref 128837 // GL3 + classrelation_ref 128386 // <realization> + b parent class_ref 128130 // GL4 end end @@ -578,5 +590,121 @@ ${members}}; classrelation_ref 134341 // <association> end end + + class 128002 "GL3bc" + visibility package stereotype "interface" + cpp_decl "" + java_decl "${comment}${@}${visibility}interface ${name}${extends} { +${members}} +" + php_decl "${comment}${visibility}interface ${name} { +${members}} +" + python_2_2 python_decl "" + idl_decl "${comment}${abstract}${local}interface ${name}${inherit} { +${members}}; +" + explicit_switch_type "" + + classrelation 128514 // <generalisation> + relation 128514 ---|> + a public + java "${type}" + classrelation_ref 128514 // <generalisation> + b parent class_ref 128453 // GL2 + end + + classrelation 128642 // <generalisation> + relation 128642 ---|> + a public + java "${type}" + classrelation_ref 128642 // <generalisation> + b parent class_ref 128837 // GL3 + end + end + + class 128130 "GL4" + visibility package stereotype "interface" + cpp_decl "" + java_decl "${comment}${@}${visibility}interface ${name}${extends} { +${members}} +" + php_decl "${comment}${visibility}interface ${name} { +${members}} +" + python_2_2 python_decl "" + idl_decl "${comment}${abstract}${local}interface ${name}${inherit} { +${members}}; +" + explicit_switch_type "" + + classrelation 128770 // <generalisation> + relation 128770 ---|> + a public + java "${type}" + classrelation_ref 128770 // <generalisation> + b parent class_ref 128837 // GL3 + end + end + + class 128258 "GL4bc" + visibility package stereotype "interface" + cpp_decl "" + java_decl "${comment}${@}${visibility}interface ${name}${extends} { +${members}} +" + php_decl "${comment}${visibility}interface ${name} { +${members}} +" + python_2_2 python_decl "" + idl_decl "${comment}${abstract}${local}interface ${name}${inherit} { +${members}}; +" + explicit_switch_type "" + + classrelation 128898 // <generalisation> + relation 128898 ---|> + a public + java "${type}" + classrelation_ref 128898 // <generalisation> + b parent class_ref 128002 // GL3bc + end + + classrelation 129026 // <generalisation> + relation 129026 ---|> + a public + java "${type}" + classrelation_ref 129026 // <generalisation> + b parent class_ref 128130 // GL4 + end + end + + class 128386 "GL2ES12" + visibility package stereotype "entity" + cpp_decl "" + java_decl "${comment}${@}${visibility}${final}${abstract}class ${name}${extends}${implements} { +${members}} +" + php_decl "" + python_2_2 python_decl "" + idl_decl "" + explicit_switch_type "" + + classrelation 129154 // <realization> + relation 129154 -_-|> + a public + java "${type}" + classrelation_ref 129154 // <realization> + b parent class_ref 128197 // GL2ES1 + end + + classrelation 129282 // <realization> + relation 129282 -_-|> + a public + java "${type}" + classrelation_ref 129282 // <realization> + b parent class_ref 128581 // GL2ES2 + end + end end end diff --git a/doc/deployment/JOGL-JAR-BUNDELING.txt b/doc/deployment/JOGL-JAR-BUNDELING.txt new file mode 100644 index 000000000..cf4edd7a3 --- /dev/null +++ b/doc/deployment/JOGL-JAR-BUNDELING.txt @@ -0,0 +1,138 @@ + ++++++++++++++++++++++++++++++ ++++ Native Libraries ++++++++ ++++++++++++++++++++++++++++++ + +Gluegen native libraries + libgluegen-rt.so + +NativeWindow native libraries + libnativewindow_awt.so + libnativewindow_jvm.so + libnativewindow_x11.so + + +JOGL native libraries + libjogl_desktop.so + libjogl_gl2es12.so + libjogl_es1.so + libjogl_es2.so + libjogl_cg.so + +NEWT native libraries + libnewt.so + ++++++++++++++++++++++++++++++ ++++ Gluegen - Mandatory +++++ ++++++++++++++++++++++++++++++ + +Gluegen JAR - Always + + Core [pick 1] + gluegen-rt.jar + ++++++++++++++++++++++++++++++ ++++ All In One Deployment +++ ++++++++++++++++++++++++++++++ + +This might be the best solution +for desktop (maybe webstart). + +It is much faster to download +a (maybe bigger) file once and cache +it for most purposes, than to download +tens of files where its cache might not +be reuseable. + + +With AWT: + nativewindow.all.jar + jogl.all.jar + newt.all.jar (optional, if AWT is used only) + + +Without AWT + nativewindow.all-noawt.jar + jogl.all-noawt.jar + newt.all-noawt.jar + + ++++++++++++++++++++++++++++++ ++++ Atomic Deployment +++++++ ++++++++++++++++++++++++++++++ + +This is a fine tuned solution +where every byte counts. + +It is also possible to use this +strategy as a starting point for +efficient manual deployment. + +Cores: + nativewindow.core.jar + jogl.core.jar + + Newt (optional): + newt.core.jar + newt.ogl.jar (to use NEWT with JOGL) + + +Platform (x11/win/osx/embedded) + + Chose the same platform for all picks :) + + NativeWindow [pick 0..1]: + nativewindow.os.x11.jar + + Jogl [pick 1]: + jogl.egl.jar + jogl.os.x11.jar + jogl.os.win.jar + jogl.os.osx.jar + + Newt [pick 0..1] (optional): + newt.os.x11.jar + newt.os.win.jar + newt.os.osx.jar + + +Jogl GL [pick 1..n] + jogl.gles1.jar + jogl.gles1.dbg.jar + jogl.gles2.jar + jogl.gles2.dbg.jar + + jogl.gl2es12.jar + + jogl.gl2.jar + jogl.gl2.dbg.jar + + jogl.gl3.jar + jogl.gl3.dbg.jar + + jogl.gl4.jar + jogl.gl4.dbg.jar + + +Jogl Toolkits/Misc [pick n] (optional): + jogl.util.jar + jogl.util.gl2.jar + jogl.util.fixedfuncemu.jar + + +AWT [pick n] (optional): + nativewindow.awt.jar + + jogl.awt.jar + jogl.util.awt.jar (if using jogl.util) + + newt.awt.jar + +GLU [pick n] (optional): + jogl.glutess.jar + jogl.glumipmap.jar + jogl.glugl2.jar + + + + diff --git a/doc/deployment/lstjars/lstjars.linux_amd64-20100406.log b/doc/deployment/lstjars/lstjars.linux_amd64-20100406.log new file mode 100644 index 000000000..48dcd562c --- /dev/null +++ b/doc/deployment/lstjars/lstjars.linux_amd64-20100406.log @@ -0,0 +1,540 @@ +cp: cannot stat `../../gluegen/build-x86_64/gluegen-rt-natives-linux-i586.jar': No such file or directory +cp: cannot stat `../../gluegen/build-x86_64/gluegen-rt-natives-linux-i586-cdc.jar': No such file or directory +Native Libraries +4 libgluegen-rt.so.gz +24 libjogl_cg.so.gz +144 libjogl_desktop.so.gz +36 libjogl_es1.so.gz +36 libjogl_es2.so.gz +40 libjogl_gl2es12.so.gz +4 libnativewindow_awt.so.gz +4 libnativewindow_jvm.so.gz +8 libnativewindow_x11.so.gz +12 libnewt.so.gz +312 total + +list gluegen-rt-cdc.jar to gluegen-rt-cdc.lst +list gluegen-rt.jar to gluegen-rt.lst +list jogl.all.cdc.jar to jogl.all.cdc.lst +list jogl.all.jar to jogl.all.lst +list jogl.all-noawt.jar to jogl.all-noawt.lst +list jogl.awt.jar to jogl.awt.lst +list jogl.cg.jar to jogl.cg.lst +list jogl.core.cdc.jar to jogl.core.cdc.lst +list jogl.core.jar to jogl.core.lst +list jogl.egl.cdc.jar to jogl.egl.cdc.lst +list jogl.egl.jar to jogl.egl.lst +list jogl.gl2.dbg.jar to jogl.gl2.dbg.lst +list jogl.gl2es12.cdc.jar to jogl.gl2es12.cdc.lst +list jogl.gl2es12.jar to jogl.gl2es12.lst +list jogl.gl2.jar to jogl.gl2.lst +list jogl.gl3.dbg.jar to jogl.gl3.dbg.lst +list jogl.gl3.jar to jogl.gl3.lst +list jogl.gl4.dbg.jar to jogl.gl4.dbg.lst +list jogl.gl4.jar to jogl.gl4.lst +list jogl.gles1.cdc.jar to jogl.gles1.cdc.lst +list jogl.gles1.dbg.cdc.jar to jogl.gles1.dbg.cdc.lst +list jogl.gles1.dbg.jar to jogl.gles1.dbg.lst +list jogl.gles1.jar to jogl.gles1.lst +list jogl.gles2.cdc.jar to jogl.gles2.cdc.lst +list jogl.gles2.dbg.cdc.jar to jogl.gles2.dbg.cdc.lst +list jogl.gles2.dbg.jar to jogl.gles2.dbg.lst +list jogl.gles2.jar to jogl.gles2.lst +list jogl.glu.gl2.jar to jogl.glu.gl2.lst +list jogl.glu.mipmap.cdc.jar to jogl.glu.mipmap.cdc.lst +list jogl.glu.mipmap.jar to jogl.glu.mipmap.lst +list jogl.glu.tess.cdc.jar to jogl.glu.tess.cdc.lst +list jogl.glu.tess.jar to jogl.glu.tess.lst +list jogl-natives-linux-amd64-cdc.jar to jogl-natives-linux-amd64-cdc.lst +list jogl-natives-linux-amd64.jar to jogl-natives-linux-amd64.lst +list jogl.os.osx.cdc.jar to jogl.os.osx.cdc.lst +list jogl.os.osx.jar to jogl.os.osx.lst +list jogl.os.win.cdc.jar to jogl.os.win.cdc.lst +list jogl.os.win.jar to jogl.os.win.lst +list jogl.os.x11.cdc.jar to jogl.os.x11.cdc.lst +list jogl.os.x11.jar to jogl.os.x11.lst +list jogl.sdk.jar to jogl.sdk.lst +list jogl.test.jar to jogl.test.lst +list jogl.util.awt.jar to jogl.util.awt.lst +list jogl.util.cdc.jar to jogl.util.cdc.lst +list jogl.util.fixedfuncemu.cdc.jar to jogl.util.fixedfuncemu.cdc.lst +list jogl.util.fixedfuncemu.jar to jogl.util.fixedfuncemu.lst +list jogl.util.gl2.jar to jogl.util.gl2.lst +list jogl.util.jar to jogl.util.lst +list nativewindow.all.cdc.jar to nativewindow.all.cdc.lst +list nativewindow.all.jar to nativewindow.all.lst +list nativewindow.all-noawt.jar to nativewindow.all-noawt.lst +list nativewindow.awt.jar to nativewindow.awt.lst +list nativewindow.core.cdc.jar to nativewindow.core.cdc.lst +list nativewindow.core.jar to nativewindow.core.lst +list nativewindow-natives-linux-amd64-cdc.jar to nativewindow-natives-linux-amd64-cdc.lst +list nativewindow-natives-linux-amd64.jar to nativewindow-natives-linux-amd64.lst +list nativewindow.os.x11.cdc.jar to nativewindow.os.x11.cdc.lst +list nativewindow.os.x11.jar to nativewindow.os.x11.lst +list newt.all.cdc.jar to newt.all.cdc.lst +list newt.all.jar to newt.all.lst +list newt.all-noawt.jar to newt.all-noawt.lst +list newt.awt.jar to newt.awt.lst +list newt.broadcomegl.cdc.jar to newt.broadcomegl.cdc.lst +list newt.broadcomegl.jar to newt.broadcomegl.lst +list newt.core.cdc.jar to newt.core.cdc.lst +list newt.core.jar to newt.core.lst +list newt-natives-linux-amd64-cdc.jar to newt-natives-linux-amd64-cdc.lst +list newt-natives-linux-amd64.jar to newt-natives-linux-amd64.lst +list newt.ogl.cdc.jar to newt.ogl.cdc.lst +list newt.ogl.jar to newt.ogl.lst +list newt.os.osx.jar to newt.os.osx.lst +list newt.os.win.jar to newt.os.win.lst +list newt.os.x11.jar to newt.os.x11.lst +mv: cannot stat `jogl.all.cdc.lst': No such file or directory +mv: cannot stat `nativewindow.all.cdc.lst': No such file or directory +mv: cannot stat `newt.all.cdc.lst': No such file or directory +mv: cannot stat `jogl.gl2es12.*.lst': No such file or directory +duplicates - w/o gl2es12.* gl2.* + +com/jogamp/openmax/OMXEventListener.class +com/jogamp/openmax/OMXInstance.class +com/jogamp/openmax/OMXInstance$EGLImageTexture.class +mv: cannot stat `jogl.all.cdc.lst': No such file or directory +mv: cannot stat `nativewindow.all.cdc.lst': No such file or directory +mv: cannot stat `newt.all.cdc.lst': No such file or directory +all vs allparts delta + +--- allparts.lst 2010-04-06 14:27:30.945355748 +0200 ++++ allall.lst 2010-04-06 14:27:31.002253659 +0200 +@@ -1,3 +1,10 @@ ++com/jogamp/audio/windows/waveout/Audio.class ++com/jogamp/audio/windows/waveout/Mixer.class ++com/jogamp/audio/windows/waveout/Mixer$FillerThread.class ++com/jogamp/audio/windows/waveout/Mixer$MixerThread.class ++com/jogamp/audio/windows/waveout/SoundBuffer.class ++com/jogamp/audio/windows/waveout/Track.class ++com/jogamp/audio/windows/waveout/Vec3f.class + com/jogamp/common/nio/AbstractBuffer.class + com/jogamp/common/nio/AbstractLongBuffer.class + com/jogamp/common/nio/Buffers.class +JOGL Deployment Payload for jar + +JOGL ES1 NEWT CORE +44 gluegen-rt.jar +48 nativewindow.all-noawt.jar +148 jogl.core.jar +116 jogl.util.jar +44 jogl.egl.jar +28 jogl.gles1.jar +88 newt.all-noawt.jar +4 libgluegen-rt.so.gz +4 libnativewindow_jvm.so.gz +36 libjogl_es1.so.gz +12 libnewt.so.gz +572 total + +JOGL ES2 NEWT CORE +44 gluegen-rt.jar +48 nativewindow.all-noawt.jar +148 jogl.core.jar +116 jogl.util.jar +44 jogl.egl.jar +32 jogl.gles2.jar +88 newt.all-noawt.jar +4 libgluegen-rt.so.gz +4 libnativewindow_jvm.so.gz +36 libjogl_es2.so.gz +12 libnewt.so.gz +576 total + +JOGL ES2 NEWT CORE FIXED +44 gluegen-rt.jar +48 nativewindow.all-noawt.jar +148 jogl.core.jar +116 jogl.util.jar +44 jogl.egl.jar +32 jogl.gles2.jar +28 jogl.util.fixedfuncemu.jar +88 newt.all-noawt.jar +4 libgluegen-rt.so.gz +4 libnativewindow_jvm.so.gz +36 libjogl_es2.so.gz +12 libnewt.so.gz +604 total + +JOGL GL2ES12 NEWT +44 gluegen-rt.jar +48 nativewindow.all-noawt.jar +148 jogl.core.jar +116 jogl.util.jar +56 jogl.os.x11.jar +36 jogl.gl2es12.jar +88 newt.all-noawt.jar +4 libgluegen-rt.so.gz +40 libjogl_gl2es12.so.gz +12 libnewt.so.gz +8 libnativewindow_x11.so.gz +4 libnativewindow_jvm.so.gz +604 total + +JOGL GL2 NEWT +44 gluegen-rt.jar +48 nativewindow.all-noawt.jar +148 jogl.core.jar +116 jogl.util.jar +56 jogl.os.x11.jar +120 jogl.gl2.jar +88 newt.all-noawt.jar +4 libgluegen-rt.so.gz +144 libjogl_desktop.so.gz +12 libnewt.so.gz +8 libnativewindow_x11.so.gz +4 libnativewindow_jvm.so.gz +792 total + +JOGL GL2 AWT +44 gluegen-rt.jar +84 nativewindow.all.jar +148 jogl.core.jar +116 jogl.util.jar +56 jogl.os.x11.jar +120 jogl.gl2.jar +64 jogl.awt.jar +4 libgluegen-rt.so.gz +144 libjogl_desktop.so.gz +8 libnativewindow_x11.so.gz +4 libnativewindow_awt.so.gz +4 libnativewindow_jvm.so.gz +796 total + +JOGL ALL AWT +44 gluegen-rt.jar +84 nativewindow.all.jar +1876 jogl.all.jar +4 libgluegen-rt.so.gz +144 libjogl_desktop.so.gz +8 libnativewindow_x11.so.gz +4 libnativewindow_awt.so.gz +4 libnativewindow_jvm.so.gz +2168 total + +JOGL ALL No AWT +44 gluegen-rt.jar +48 nativewindow.all-noawt.jar +1772 jogl.all-noawt.jar +88 newt.all-noawt.jar +4 libgluegen-rt.so.gz +144 libjogl_desktop.so.gz +8 libnativewindow_x11.so.gz +4 libnativewindow_jvm.so.gz +12 libnewt.so.gz +2124 total + +JOGL CDCFP DESKTOP +44 gluegen-rt-cdc.jar +84 nativewindow.all.jar +792 jogl.all.cdc.jar +88 newt.all.cdc.jar +4 libgluegen-rt.so.gz +40 libjogl_gl2es12.so.gz +8 libnativewindow_x11.so.gz +4 libnativewindow_jvm.so.gz +12 libnewt.so.gz +1076 total + +JOGL CDCFP ES1 MOBILE +44 gluegen-rt-cdc.jar +148 jogl.core.cdc.jar +44 jogl.egl.cdc.jar +28 jogl.gles1.cdc.jar +116 jogl.util.cdc.jar +48 nativewindow.all.cdc.jar +88 newt.all.cdc.jar +4 libgluegen-rt.so.gz +36 libjogl_es1.so.gz +4 libnativewindow_jvm.so.gz +12 libnewt.so.gz +572 total + +JOGL CDCFP ES2 MOBILE +44 gluegen-rt-cdc.jar +148 jogl.core.cdc.jar +44 jogl.egl.cdc.jar +32 jogl.gles2.cdc.jar +116 jogl.util.cdc.jar +48 nativewindow.all.cdc.jar +88 newt.all.cdc.jar +4 libgluegen-rt.so.gz +36 libjogl_es2.so.gz +4 libnativewindow_jvm.so.gz +12 libnewt.so.gz +576 total + +JOGL GLU +56 jogl.glu.gl2.jar +68 jogl.glu.mipmap.cdc.jar +68 jogl.glu.mipmap.jar +48 jogl.glu.tess.cdc.jar +48 jogl.glu.tess.jar +288 total + +JOGL EVERYTHING +1876 jogl.all.jar +84 nativewindow.all.jar +108 newt.all.jar +4 libgluegen-rt.so.gz +4 libnativewindow_jvm.so.gz +8 libnativewindow_x11.so.gz +4 libnativewindow_awt.so.gz +144 libjogl_desktop.so.gz +36 libjogl_es1.so.gz +36 libjogl_es2.so.gz +40 libjogl_gl2es12.so.gz +12 libnewt.so.gz +2356 total + +pack200 gluegen-rt-cdc.pack.gz gluegen-rt-cdc.jar +pack200 gluegen-rt.pack.gz gluegen-rt.jar +pack200 jogl.all.cdc.pack.gz jogl.all.cdc.jar +pack200 jogl.all.pack.gz jogl.all.jar +pack200 jogl.all-noawt.pack.gz jogl.all-noawt.jar +pack200 jogl.awt.pack.gz jogl.awt.jar +pack200 jogl.cg.pack.gz jogl.cg.jar +pack200 jogl.core.cdc.pack.gz jogl.core.cdc.jar +pack200 jogl.core.pack.gz jogl.core.jar +pack200 jogl.egl.cdc.pack.gz jogl.egl.cdc.jar +pack200 jogl.egl.pack.gz jogl.egl.jar +pack200 jogl.gl2.dbg.pack.gz jogl.gl2.dbg.jar +pack200 jogl.gl2es12.cdc.pack.gz jogl.gl2es12.cdc.jar +pack200 jogl.gl2es12.pack.gz jogl.gl2es12.jar +pack200 jogl.gl2.pack.gz jogl.gl2.jar +pack200 jogl.gl3.dbg.pack.gz jogl.gl3.dbg.jar +pack200 jogl.gl3.pack.gz jogl.gl3.jar +pack200 jogl.gl4.dbg.pack.gz jogl.gl4.dbg.jar +pack200 jogl.gl4.pack.gz jogl.gl4.jar +pack200 jogl.gles1.cdc.pack.gz jogl.gles1.cdc.jar +pack200 jogl.gles1.dbg.cdc.pack.gz jogl.gles1.dbg.cdc.jar +pack200 jogl.gles1.dbg.pack.gz jogl.gles1.dbg.jar +pack200 jogl.gles1.pack.gz jogl.gles1.jar +pack200 jogl.gles2.cdc.pack.gz jogl.gles2.cdc.jar +pack200 jogl.gles2.dbg.cdc.pack.gz jogl.gles2.dbg.cdc.jar +pack200 jogl.gles2.dbg.pack.gz jogl.gles2.dbg.jar +pack200 jogl.gles2.pack.gz jogl.gles2.jar +pack200 jogl.glu.gl2.pack.gz jogl.glu.gl2.jar +pack200 jogl.glu.mipmap.cdc.pack.gz jogl.glu.mipmap.cdc.jar +pack200 jogl.glu.mipmap.pack.gz jogl.glu.mipmap.jar +pack200 jogl.glu.tess.cdc.pack.gz jogl.glu.tess.cdc.jar +pack200 jogl.glu.tess.pack.gz jogl.glu.tess.jar +pack200 jogl-natives-linux-amd64-cdc.pack.gz jogl-natives-linux-amd64-cdc.jar +pack200 jogl-natives-linux-amd64.pack.gz jogl-natives-linux-amd64.jar +pack200 jogl.os.osx.cdc.pack.gz jogl.os.osx.cdc.jar +pack200 jogl.os.osx.pack.gz jogl.os.osx.jar +pack200 jogl.os.win.cdc.pack.gz jogl.os.win.cdc.jar +pack200 jogl.os.win.pack.gz jogl.os.win.jar +pack200 jogl.os.x11.cdc.pack.gz jogl.os.x11.cdc.jar +pack200 jogl.os.x11.pack.gz jogl.os.x11.jar +pack200 jogl.sdk.pack.gz jogl.sdk.jar +pack200 jogl.test.pack.gz jogl.test.jar +pack200 jogl.util.awt.pack.gz jogl.util.awt.jar +pack200 jogl.util.cdc.pack.gz jogl.util.cdc.jar +pack200 jogl.util.fixedfuncemu.cdc.pack.gz jogl.util.fixedfuncemu.cdc.jar +pack200 jogl.util.fixedfuncemu.pack.gz jogl.util.fixedfuncemu.jar +pack200 jogl.util.gl2.pack.gz jogl.util.gl2.jar +pack200 jogl.util.pack.gz jogl.util.jar +pack200 nativewindow.all.cdc.pack.gz nativewindow.all.cdc.jar +pack200 nativewindow.all.pack.gz nativewindow.all.jar +pack200 nativewindow.all-noawt.pack.gz nativewindow.all-noawt.jar +pack200 nativewindow.awt.pack.gz nativewindow.awt.jar +pack200 nativewindow.core.cdc.pack.gz nativewindow.core.cdc.jar +pack200 nativewindow.core.pack.gz nativewindow.core.jar +pack200 nativewindow-natives-linux-amd64-cdc.pack.gz nativewindow-natives-linux-amd64-cdc.jar +pack200 nativewindow-natives-linux-amd64.pack.gz nativewindow-natives-linux-amd64.jar +pack200 nativewindow.os.x11.cdc.pack.gz nativewindow.os.x11.cdc.jar +pack200 nativewindow.os.x11.pack.gz nativewindow.os.x11.jar +pack200 newt.all.cdc.pack.gz newt.all.cdc.jar +pack200 newt.all.pack.gz newt.all.jar +pack200 newt.all-noawt.pack.gz newt.all-noawt.jar +pack200 newt.awt.pack.gz newt.awt.jar +pack200 newt.broadcomegl.cdc.pack.gz newt.broadcomegl.cdc.jar +pack200 newt.broadcomegl.pack.gz newt.broadcomegl.jar +pack200 newt.core.cdc.pack.gz newt.core.cdc.jar +pack200 newt.core.pack.gz newt.core.jar +pack200 newt-natives-linux-amd64-cdc.pack.gz newt-natives-linux-amd64-cdc.jar +pack200 newt-natives-linux-amd64.pack.gz newt-natives-linux-amd64.jar +pack200 newt.ogl.cdc.pack.gz newt.ogl.cdc.jar +pack200 newt.ogl.pack.gz newt.ogl.jar +pack200 newt.os.osx.pack.gz newt.os.osx.jar +pack200 newt.os.win.pack.gz newt.os.win.jar +pack200 newt.os.x11.pack.gz newt.os.x11.jar +JOGL Deployment Payload for pack.gz + +JOGL ES1 NEWT CORE +16 gluegen-rt.pack.gz +12 nativewindow.all-noawt.pack.gz +56 jogl.core.pack.gz +44 jogl.util.pack.gz +16 jogl.egl.pack.gz +12 jogl.gles1.pack.gz +28 newt.all-noawt.pack.gz +4 libgluegen-rt.so.gz +4 libnativewindow_jvm.so.gz +36 libjogl_es1.so.gz +12 libnewt.so.gz +240 total + +JOGL ES2 NEWT CORE +16 gluegen-rt.pack.gz +12 nativewindow.all-noawt.pack.gz +56 jogl.core.pack.gz +44 jogl.util.pack.gz +16 jogl.egl.pack.gz +16 jogl.gles2.pack.gz +28 newt.all-noawt.pack.gz +4 libgluegen-rt.so.gz +4 libnativewindow_jvm.so.gz +36 libjogl_es2.so.gz +12 libnewt.so.gz +244 total + +JOGL ES2 NEWT CORE FIXED +16 gluegen-rt.pack.gz +12 nativewindow.all-noawt.pack.gz +56 jogl.core.pack.gz +44 jogl.util.pack.gz +16 jogl.egl.pack.gz +16 jogl.gles2.pack.gz +16 jogl.util.fixedfuncemu.pack.gz +28 newt.all-noawt.pack.gz +4 libgluegen-rt.so.gz +4 libnativewindow_jvm.so.gz +36 libjogl_es2.so.gz +12 libnewt.so.gz +260 total + +JOGL GL2ES12 NEWT +16 gluegen-rt.pack.gz +12 nativewindow.all-noawt.pack.gz +56 jogl.core.pack.gz +44 jogl.util.pack.gz +24 jogl.os.x11.pack.gz +16 jogl.gl2es12.pack.gz +28 newt.all-noawt.pack.gz +4 libgluegen-rt.so.gz +40 libjogl_gl2es12.so.gz +12 libnewt.so.gz +8 libnativewindow_x11.so.gz +4 libnativewindow_jvm.so.gz +264 total + +JOGL GL2 NEWT +16 gluegen-rt.pack.gz +12 nativewindow.all-noawt.pack.gz +56 jogl.core.pack.gz +44 jogl.util.pack.gz +24 jogl.os.x11.pack.gz +60 jogl.gl2.pack.gz +28 newt.all-noawt.pack.gz +4 libgluegen-rt.so.gz +144 libjogl_desktop.so.gz +12 libnewt.so.gz +8 libnativewindow_x11.so.gz +4 libnativewindow_jvm.so.gz +412 total + +JOGL GL2 AWT +16 gluegen-rt.pack.gz +20 nativewindow.all.pack.gz +56 jogl.core.pack.gz +44 jogl.util.pack.gz +24 jogl.os.x11.pack.gz +60 jogl.gl2.pack.gz +20 jogl.awt.pack.gz +4 libgluegen-rt.so.gz +144 libjogl_desktop.so.gz +8 libnativewindow_x11.so.gz +4 libnativewindow_awt.so.gz +4 libnativewindow_jvm.so.gz +404 total + +JOGL ALL AWT +16 gluegen-rt.pack.gz +20 nativewindow.all.pack.gz +680 jogl.all.pack.gz +4 libgluegen-rt.so.gz +144 libjogl_desktop.so.gz +8 libnativewindow_x11.so.gz +4 libnativewindow_awt.so.gz +4 libnativewindow_jvm.so.gz +880 total + +JOGL ALL No AWT +16 gluegen-rt.pack.gz +12 nativewindow.all-noawt.pack.gz +612 jogl.all-noawt.pack.gz +28 newt.all-noawt.pack.gz +4 libgluegen-rt.so.gz +144 libjogl_desktop.so.gz +8 libnativewindow_x11.so.gz +4 libnativewindow_jvm.so.gz +12 libnewt.so.gz +840 total + +JOGL CDCFP DESKTOP +16 gluegen-rt-cdc.pack.gz +20 nativewindow.all.pack.gz +232 jogl.all.cdc.pack.gz +28 newt.all.cdc.pack.gz +4 libgluegen-rt.so.gz +40 libjogl_gl2es12.so.gz +8 libnativewindow_x11.so.gz +4 libnativewindow_jvm.so.gz +12 libnewt.so.gz +364 total + +JOGL CDCFP ES1 MOBILE +16 gluegen-rt-cdc.pack.gz +56 jogl.core.cdc.pack.gz +16 jogl.egl.cdc.pack.gz +12 jogl.gles1.cdc.pack.gz +44 jogl.util.cdc.pack.gz +12 nativewindow.all.cdc.pack.gz +28 newt.all.cdc.pack.gz +4 libgluegen-rt.so.gz +36 libjogl_es1.so.gz +4 libnativewindow_jvm.so.gz +12 libnewt.so.gz +240 total + +JOGL CDCFP ES2 MOBILE +16 gluegen-rt-cdc.pack.gz +56 jogl.core.cdc.pack.gz +16 jogl.egl.cdc.pack.gz +16 jogl.gles2.cdc.pack.gz +44 jogl.util.cdc.pack.gz +12 nativewindow.all.cdc.pack.gz +28 newt.all.cdc.pack.gz +4 libgluegen-rt.so.gz +36 libjogl_es2.so.gz +4 libnativewindow_jvm.so.gz +12 libnewt.so.gz +244 total + +JOGL GLU +20 jogl.glu.gl2.pack.gz +24 jogl.glu.mipmap.cdc.pack.gz +24 jogl.glu.mipmap.pack.gz +20 jogl.glu.tess.cdc.pack.gz +20 jogl.glu.tess.pack.gz +108 total + +JOGL EVERYTHING +680 jogl.all.pack.gz +20 nativewindow.all.pack.gz +32 newt.all.pack.gz +4 libgluegen-rt.so.gz +4 libnativewindow_jvm.so.gz +8 libnativewindow_x11.so.gz +4 libnativewindow_awt.so.gz +144 libjogl_desktop.so.gz +36 libjogl_es1.so.gz +36 libjogl_es2.so.gz +40 libjogl_gl2es12.so.gz +12 libnewt.so.gz +1020 total + diff --git a/doc/deployment/lstjars/lstjars.linux_amd64-20100420.log b/doc/deployment/lstjars/lstjars.linux_amd64-20100420.log new file mode 100644 index 000000000..3e455a7fc --- /dev/null +++ b/doc/deployment/lstjars/lstjars.linux_amd64-20100420.log @@ -0,0 +1,524 @@ +cp: cannot stat `../../gluegen/build-x86_64/gluegen-rt-natives-linux-i586.jar': No such file or directory +cp: cannot stat `../../gluegen/build-x86_64/gluegen-rt-natives-linux-i586-cdc.jar': No such file or directory +Native Libraries +4 libgluegen-rt.so.gz +24 libjogl_cg.so.gz +120 libjogl_desktop.so.gz +36 libjogl_es1.so.gz +36 libjogl_es2.so.gz +4 libnativewindow_awt.so.gz +8 libnativewindow_x11.so.gz +12 libnewt.so.gz +244 total + +list gluegen-rt-cdc.jar to gluegen-rt-cdc.lst +list gluegen-rt.jar to gluegen-rt.lst +list jogl.all.cdc.jar to jogl.all.cdc.lst +list jogl.all.jar to jogl.all.lst +list jogl.all-noawt.jar to jogl.all-noawt.lst +list jogl.awt.jar to jogl.awt.lst +list jogl.cg.jar to jogl.cg.lst +list jogl.core.cdc.jar to jogl.core.cdc.lst +list jogl.core.jar to jogl.core.lst +list jogl.egl.cdc.jar to jogl.egl.cdc.lst +list jogl.egl.jar to jogl.egl.lst +list jogl.gl2.dbg.jar to jogl.gl2.dbg.lst +list jogl.gl2.jar to jogl.gl2.lst +list jogl.gl3.dbg.jar to jogl.gl3.dbg.lst +list jogl.gl3.jar to jogl.gl3.lst +list jogl.gl4.dbg.jar to jogl.gl4.dbg.lst +list jogl.gl4.jar to jogl.gl4.lst +list jogl.gles1.cdc.jar to jogl.gles1.cdc.lst +list jogl.gles1.dbg.cdc.jar to jogl.gles1.dbg.cdc.lst +list jogl.gles1.dbg.jar to jogl.gles1.dbg.lst +list jogl.gles1.jar to jogl.gles1.lst +list jogl.gles2.cdc.jar to jogl.gles2.cdc.lst +list jogl.gles2.dbg.cdc.jar to jogl.gles2.dbg.cdc.lst +list jogl.gles2.dbg.jar to jogl.gles2.dbg.lst +list jogl.gles2.jar to jogl.gles2.lst +list jogl.glu.gl2.jar to jogl.glu.gl2.lst +list jogl.glu.mipmap.cdc.jar to jogl.glu.mipmap.cdc.lst +list jogl.glu.mipmap.jar to jogl.glu.mipmap.lst +list jogl.glu.tess.cdc.jar to jogl.glu.tess.cdc.lst +list jogl.glu.tess.jar to jogl.glu.tess.lst +list jogl-natives-linux-amd64-cdc.jar to jogl-natives-linux-amd64-cdc.lst +list jogl-natives-linux-amd64.jar to jogl-natives-linux-amd64.lst +list jogl.os.osx.jar to jogl.os.osx.lst +list jogl.os.win.jar to jogl.os.win.lst +list jogl.os.x11.jar to jogl.os.x11.lst +list jogl.sdk.jar to jogl.sdk.lst +list jogl.test.jar to jogl.test.lst +list jogl.util.awt.jar to jogl.util.awt.lst +list jogl.util.cdc.jar to jogl.util.cdc.lst +list jogl.util.fixedfuncemu.cdc.jar to jogl.util.fixedfuncemu.cdc.lst +list jogl.util.fixedfuncemu.jar to jogl.util.fixedfuncemu.lst +list jogl.util.gl2.jar to jogl.util.gl2.lst +list jogl.util.jar to jogl.util.lst +list nativewindow.all.cdc.jar to nativewindow.all.cdc.lst +list nativewindow.all.jar to nativewindow.all.lst +list nativewindow.all-noawt.jar to nativewindow.all-noawt.lst +list nativewindow.awt.jar to nativewindow.awt.lst +list nativewindow.core.cdc.jar to nativewindow.core.cdc.lst +list nativewindow.core.jar to nativewindow.core.lst +list nativewindow-natives-linux-amd64-cdc.jar to nativewindow-natives-linux-amd64-cdc.lst +list nativewindow-natives-linux-amd64.jar to nativewindow-natives-linux-amd64.lst +list nativewindow.os.x11.cdc.jar to nativewindow.os.x11.cdc.lst +list nativewindow.os.x11.jar to nativewindow.os.x11.lst +list newt.all.cdc.jar to newt.all.cdc.lst +list newt.all.jar to newt.all.lst +list newt.all-noawt.jar to newt.all-noawt.lst +list newt.awt.jar to newt.awt.lst +list newt.broadcomegl.cdc.jar to newt.broadcomegl.cdc.lst +list newt.broadcomegl.jar to newt.broadcomegl.lst +list newt.core.cdc.jar to newt.core.cdc.lst +list newt.core.jar to newt.core.lst +list newt-natives-linux-amd64-cdc.jar to newt-natives-linux-amd64-cdc.lst +list newt-natives-linux-amd64.jar to newt-natives-linux-amd64.lst +list newt.ogl.cdc.jar to newt.ogl.cdc.lst +list newt.ogl.jar to newt.ogl.lst +list newt.os.osx.cdc.jar to newt.os.osx.cdc.lst +list newt.os.osx.jar to newt.os.osx.lst +list newt.os.win.cdc.jar to newt.os.win.cdc.lst +list newt.os.win.jar to newt.os.win.lst +list newt.os.x11.cdc.jar to newt.os.x11.cdc.lst +list newt.os.x11.jar to newt.os.x11.lst +mv: cannot stat `jogl.all.cdc.lst': No such file or directory +mv: cannot stat `nativewindow.all.cdc.lst': No such file or directory +mv: cannot stat `newt.all.cdc.lst': No such file or directory +duplicates - w/o gl2.* + +com/jogamp/openmax/OMXEventListener.class +com/jogamp/openmax/OMXInstance.class +com/jogamp/openmax/OMXInstance$EGLImageTexture.class +mv: cannot stat `jogl.all.cdc.lst': No such file or directory +mv: cannot stat `nativewindow.all.cdc.lst': No such file or directory +mv: cannot stat `newt.all.cdc.lst': No such file or directory +all vs allparts delta + +--- allparts.lst 2010-04-20 11:59:19.760514140 +0200 ++++ allall.lst 2010-04-20 11:59:19.790598127 +0200 +@@ -1,3 +1,10 @@ ++com/jogamp/audio/windows/waveout/Audio.class ++com/jogamp/audio/windows/waveout/Mixer.class ++com/jogamp/audio/windows/waveout/Mixer$FillerThread.class ++com/jogamp/audio/windows/waveout/Mixer$MixerThread.class ++com/jogamp/audio/windows/waveout/SoundBuffer.class ++com/jogamp/audio/windows/waveout/Track.class ++com/jogamp/audio/windows/waveout/Vec3f.class + com/jogamp/common/impl/Debug$1.class + com/jogamp/common/impl/Debug.class + com/jogamp/common/JogampRuntimeException.class +@@ -616,22 +623,6 @@ + com/jogamp/openmax/OMXEventListener.class + com/jogamp/openmax/OMXInstance.class + com/jogamp/openmax/OMXInstance$EGLImageTexture.class +-com/jogamp/test/junit/jogl/acore/TestGLProfile01CORE.class +-com/jogamp/test/junit/jogl/awt/TestAWT01GLn.class +-com/jogamp/test/junit/jogl/demos/es1/RedSquare.class +-com/jogamp/test/junit/jogl/demos/gl2/gears/Gears.class +-com/jogamp/test/junit/jogl/drawable/TestDrawable01NEWT.class +-com/jogamp/test/junit/jogl/offscreen/ReadBuffer2File.class +-com/jogamp/test/junit/jogl/offscreen/ReadBuffer2Screen.class +-com/jogamp/test/junit/jogl/offscreen/ReadBufferBase.class +-com/jogamp/test/junit/jogl/offscreen/ReadBufferUtil.class +-com/jogamp/test/junit/jogl/offscreen/Surface2File.class +-com/jogamp/test/junit/jogl/offscreen/TestOffscreen01NEWT.class +-com/jogamp/test/junit/jogl/offscreen/WindowUtilNEWT.class +-com/jogamp/test/junit/jogl/texture/TestTexture01AWT.class +-com/jogamp/test/junit/jogl/util/texture/gl2/TextureGL2ListenerDraw1.class +-com/jogamp/test/junit/newt/TestWindows01NEWT.class +-com/jogamp/test/junit/util/MiscUtils.class + javax/media/nativewindow/AbstractGraphicsConfiguration.class + javax/media/nativewindow/AbstractGraphicsDevice.class + javax/media/nativewindow/AbstractGraphicsScreen.class +JOGL Deployment Payload for jar + +JOGL ES1 NEWT CORE +72 gluegen-rt.jar +44 nativewindow.all-noawt.jar +152 jogl.core.jar +116 jogl.util.jar +44 jogl.egl.jar +28 jogl.gles1.jar +92 newt.all-noawt.jar +4 libgluegen-rt.so.gz +36 libjogl_es1.so.gz +12 libnewt.so.gz +600 total + +JOGL ES2 NEWT CORE +72 gluegen-rt.jar +44 nativewindow.all-noawt.jar +152 jogl.core.jar +116 jogl.util.jar +44 jogl.egl.jar +32 jogl.gles2.jar +92 newt.all-noawt.jar +4 libgluegen-rt.so.gz +36 libjogl_es2.so.gz +12 libnewt.so.gz +604 total + +JOGL ES2 NEWT CORE FIXED +72 gluegen-rt.jar +44 nativewindow.all-noawt.jar +152 jogl.core.jar +116 jogl.util.jar +44 jogl.egl.jar +32 jogl.gles2.jar +28 jogl.util.fixedfuncemu.jar +92 newt.all-noawt.jar +4 libgluegen-rt.so.gz +36 libjogl_es2.so.gz +12 libnewt.so.gz +632 total + +JOGL GL2ES12 NEWT +72 gluegen-rt.jar +44 nativewindow.all-noawt.jar +152 jogl.core.jar +116 jogl.util.jar +60 jogl.os.x11.jar +92 newt.all-noawt.jar +4 libgluegen-rt.so.gz +12 libnewt.so.gz +8 libnativewindow_x11.so.gz +560 total + +JOGL GL2 NEWT +72 gluegen-rt.jar +44 nativewindow.all-noawt.jar +152 jogl.core.jar +116 jogl.util.jar +60 jogl.os.x11.jar +16 jogl.gl2.jar +92 newt.all-noawt.jar +4 libgluegen-rt.so.gz +120 libjogl_desktop.so.gz +12 libnewt.so.gz +8 libnativewindow_x11.so.gz +696 total + +JOGL GL2 AWT +72 gluegen-rt.jar +80 nativewindow.all.jar +152 jogl.core.jar +116 jogl.util.jar +60 jogl.os.x11.jar +16 jogl.gl2.jar +64 jogl.awt.jar +4 libgluegen-rt.so.gz +120 libjogl_desktop.so.gz +8 libnativewindow_x11.so.gz +4 libnativewindow_awt.so.gz +696 total + +JOGL ALL AWT +72 gluegen-rt.jar +80 nativewindow.all.jar +1948 jogl.all.jar +4 libgluegen-rt.so.gz +120 libjogl_desktop.so.gz +8 libnativewindow_x11.so.gz +4 libnativewindow_awt.so.gz +2236 total + +JOGL ALL No AWT +72 gluegen-rt.jar +44 nativewindow.all-noawt.jar +1848 jogl.all-noawt.jar +92 newt.all-noawt.jar +4 libgluegen-rt.so.gz +120 libjogl_desktop.so.gz +8 libnativewindow_x11.so.gz +12 libnewt.so.gz +2200 total + +JOGL CDCFP DESKTOP +72 gluegen-rt-cdc.jar +80 nativewindow.all.jar +1012 jogl.all.cdc.jar +92 newt.all.cdc.jar +4 libgluegen-rt.so.gz +8 libnativewindow_x11.so.gz +12 libnewt.so.gz +1280 total + +JOGL CDCFP ES1 MOBILE +72 gluegen-rt-cdc.jar +152 jogl.core.cdc.jar +44 jogl.egl.cdc.jar +28 jogl.gles1.cdc.jar +116 jogl.util.cdc.jar +44 nativewindow.all.cdc.jar +92 newt.all.cdc.jar +4 libgluegen-rt.so.gz +36 libjogl_es1.so.gz +12 libnewt.so.gz +600 total + +JOGL CDCFP ES2 MOBILE +72 gluegen-rt-cdc.jar +152 jogl.core.cdc.jar +44 jogl.egl.cdc.jar +32 jogl.gles2.cdc.jar +116 jogl.util.cdc.jar +44 nativewindow.all.cdc.jar +92 newt.all.cdc.jar +4 libgluegen-rt.so.gz +36 libjogl_es2.so.gz +12 libnewt.so.gz +604 total + +JOGL GLU +56 jogl.glu.gl2.jar +68 jogl.glu.mipmap.cdc.jar +68 jogl.glu.mipmap.jar +48 jogl.glu.tess.cdc.jar +48 jogl.glu.tess.jar +288 total + +JOGL EVERYTHING +1948 jogl.all.jar +80 nativewindow.all.jar +108 newt.all.jar +4 libgluegen-rt.so.gz +8 libnativewindow_x11.so.gz +4 libnativewindow_awt.so.gz +120 libjogl_desktop.so.gz +36 libjogl_es1.so.gz +36 libjogl_es2.so.gz +12 libnewt.so.gz +2356 total + +pack200 gluegen-rt-cdc.pack.gz gluegen-rt-cdc.jar +pack200 gluegen-rt.pack.gz gluegen-rt.jar +pack200 jogl.all.cdc.pack.gz jogl.all.cdc.jar +pack200 jogl.all.pack.gz jogl.all.jar +pack200 jogl.all-noawt.pack.gz jogl.all-noawt.jar +pack200 jogl.awt.pack.gz jogl.awt.jar +pack200 jogl.cg.pack.gz jogl.cg.jar +pack200 jogl.core.cdc.pack.gz jogl.core.cdc.jar +pack200 jogl.core.pack.gz jogl.core.jar +pack200 jogl.egl.cdc.pack.gz jogl.egl.cdc.jar +pack200 jogl.egl.pack.gz jogl.egl.jar +pack200 jogl.gl2.dbg.pack.gz jogl.gl2.dbg.jar +pack200 jogl.gl2.pack.gz jogl.gl2.jar +pack200 jogl.gl3.dbg.pack.gz jogl.gl3.dbg.jar +pack200 jogl.gl3.pack.gz jogl.gl3.jar +pack200 jogl.gl4.dbg.pack.gz jogl.gl4.dbg.jar +pack200 jogl.gl4.pack.gz jogl.gl4.jar +pack200 jogl.gles1.cdc.pack.gz jogl.gles1.cdc.jar +pack200 jogl.gles1.dbg.cdc.pack.gz jogl.gles1.dbg.cdc.jar +pack200 jogl.gles1.dbg.pack.gz jogl.gles1.dbg.jar +pack200 jogl.gles1.pack.gz jogl.gles1.jar +pack200 jogl.gles2.cdc.pack.gz jogl.gles2.cdc.jar +pack200 jogl.gles2.dbg.cdc.pack.gz jogl.gles2.dbg.cdc.jar +pack200 jogl.gles2.dbg.pack.gz jogl.gles2.dbg.jar +pack200 jogl.gles2.pack.gz jogl.gles2.jar +pack200 jogl.glu.gl2.pack.gz jogl.glu.gl2.jar +pack200 jogl.glu.mipmap.cdc.pack.gz jogl.glu.mipmap.cdc.jar +pack200 jogl.glu.mipmap.pack.gz jogl.glu.mipmap.jar +pack200 jogl.glu.tess.cdc.pack.gz jogl.glu.tess.cdc.jar +pack200 jogl.glu.tess.pack.gz jogl.glu.tess.jar +pack200 jogl-natives-linux-amd64-cdc.pack.gz jogl-natives-linux-amd64-cdc.jar +pack200 jogl-natives-linux-amd64.pack.gz jogl-natives-linux-amd64.jar +pack200 jogl.os.osx.pack.gz jogl.os.osx.jar +pack200 jogl.os.win.pack.gz jogl.os.win.jar +pack200 jogl.os.x11.pack.gz jogl.os.x11.jar +pack200 jogl.sdk.pack.gz jogl.sdk.jar +pack200 jogl.test.pack.gz jogl.test.jar +pack200 jogl.util.awt.pack.gz jogl.util.awt.jar +pack200 jogl.util.cdc.pack.gz jogl.util.cdc.jar +pack200 jogl.util.fixedfuncemu.cdc.pack.gz jogl.util.fixedfuncemu.cdc.jar +pack200 jogl.util.fixedfuncemu.pack.gz jogl.util.fixedfuncemu.jar +pack200 jogl.util.gl2.pack.gz jogl.util.gl2.jar +pack200 jogl.util.pack.gz jogl.util.jar +pack200 nativewindow.all.cdc.pack.gz nativewindow.all.cdc.jar +pack200 nativewindow.all.pack.gz nativewindow.all.jar +pack200 nativewindow.all-noawt.pack.gz nativewindow.all-noawt.jar +pack200 nativewindow.awt.pack.gz nativewindow.awt.jar +pack200 nativewindow.core.cdc.pack.gz nativewindow.core.cdc.jar +pack200 nativewindow.core.pack.gz nativewindow.core.jar +pack200 nativewindow-natives-linux-amd64-cdc.pack.gz nativewindow-natives-linux-amd64-cdc.jar +pack200 nativewindow-natives-linux-amd64.pack.gz nativewindow-natives-linux-amd64.jar +pack200 nativewindow.os.x11.cdc.pack.gz nativewindow.os.x11.cdc.jar +pack200 nativewindow.os.x11.pack.gz nativewindow.os.x11.jar +pack200 newt.all.cdc.pack.gz newt.all.cdc.jar +pack200 newt.all.pack.gz newt.all.jar +pack200 newt.all-noawt.pack.gz newt.all-noawt.jar +pack200 newt.awt.pack.gz newt.awt.jar +pack200 newt.broadcomegl.cdc.pack.gz newt.broadcomegl.cdc.jar +pack200 newt.broadcomegl.pack.gz newt.broadcomegl.jar +pack200 newt.core.cdc.pack.gz newt.core.cdc.jar +pack200 newt.core.pack.gz newt.core.jar +pack200 newt-natives-linux-amd64-cdc.pack.gz newt-natives-linux-amd64-cdc.jar +pack200 newt-natives-linux-amd64.pack.gz newt-natives-linux-amd64.jar +pack200 newt.ogl.cdc.pack.gz newt.ogl.cdc.jar +pack200 newt.ogl.pack.gz newt.ogl.jar +pack200 newt.os.osx.cdc.pack.gz newt.os.osx.cdc.jar +pack200 newt.os.osx.pack.gz newt.os.osx.jar +pack200 newt.os.win.cdc.pack.gz newt.os.win.cdc.jar +pack200 newt.os.win.pack.gz newt.os.win.jar +pack200 newt.os.x11.cdc.pack.gz newt.os.x11.cdc.jar +pack200 newt.os.x11.pack.gz newt.os.x11.jar +JOGL Deployment Payload for pack.gz + +JOGL ES1 NEWT CORE +20 gluegen-rt.pack.gz +12 nativewindow.all-noawt.pack.gz +56 jogl.core.pack.gz +44 jogl.util.pack.gz +20 jogl.egl.pack.gz +12 jogl.gles1.pack.gz +28 newt.all-noawt.pack.gz +4 libgluegen-rt.so.gz +36 libjogl_es1.so.gz +12 libnewt.so.gz +244 total + +JOGL ES2 NEWT CORE +20 gluegen-rt.pack.gz +12 nativewindow.all-noawt.pack.gz +56 jogl.core.pack.gz +44 jogl.util.pack.gz +20 jogl.egl.pack.gz +16 jogl.gles2.pack.gz +28 newt.all-noawt.pack.gz +4 libgluegen-rt.so.gz +36 libjogl_es2.so.gz +12 libnewt.so.gz +248 total + +JOGL ES2 NEWT CORE FIXED +20 gluegen-rt.pack.gz +12 nativewindow.all-noawt.pack.gz +56 jogl.core.pack.gz +44 jogl.util.pack.gz +20 jogl.egl.pack.gz +16 jogl.gles2.pack.gz +16 jogl.util.fixedfuncemu.pack.gz +28 newt.all-noawt.pack.gz +4 libgluegen-rt.so.gz +36 libjogl_es2.so.gz +12 libnewt.so.gz +264 total + +JOGL GL2ES12 NEWT +20 gluegen-rt.pack.gz +12 nativewindow.all-noawt.pack.gz +56 jogl.core.pack.gz +44 jogl.util.pack.gz +24 jogl.os.x11.pack.gz +28 newt.all-noawt.pack.gz +4 libgluegen-rt.so.gz +12 libnewt.so.gz +8 libnativewindow_x11.so.gz +208 total + +JOGL GL2 NEWT +20 gluegen-rt.pack.gz +12 nativewindow.all-noawt.pack.gz +56 jogl.core.pack.gz +44 jogl.util.pack.gz +24 jogl.os.x11.pack.gz +8 jogl.gl2.pack.gz +28 newt.all-noawt.pack.gz +4 libgluegen-rt.so.gz +120 libjogl_desktop.so.gz +12 libnewt.so.gz +8 libnativewindow_x11.so.gz +336 total + +JOGL GL2 AWT +20 gluegen-rt.pack.gz +20 nativewindow.all.pack.gz +56 jogl.core.pack.gz +44 jogl.util.pack.gz +24 jogl.os.x11.pack.gz +8 jogl.gl2.pack.gz +20 jogl.awt.pack.gz +4 libgluegen-rt.so.gz +120 libjogl_desktop.so.gz +8 libnativewindow_x11.so.gz +4 libnativewindow_awt.so.gz +328 total + +JOGL ALL AWT +20 gluegen-rt.pack.gz +20 nativewindow.all.pack.gz +684 jogl.all.pack.gz +4 libgluegen-rt.so.gz +120 libjogl_desktop.so.gz +8 libnativewindow_x11.so.gz +4 libnativewindow_awt.so.gz +860 total + +JOGL ALL No AWT +20 gluegen-rt.pack.gz +12 nativewindow.all-noawt.pack.gz +668 jogl.all-noawt.pack.gz +28 newt.all-noawt.pack.gz +4 libgluegen-rt.so.gz +120 libjogl_desktop.so.gz +8 libnativewindow_x11.so.gz +12 libnewt.so.gz +872 total + +JOGL CDCFP DESKTOP +20 gluegen-rt-cdc.pack.gz +20 nativewindow.all.pack.gz +340 jogl.all.cdc.pack.gz +28 newt.all.cdc.pack.gz +4 libgluegen-rt.so.gz +8 libnativewindow_x11.so.gz +12 libnewt.so.gz +432 total + +JOGL CDCFP ES1 MOBILE +20 gluegen-rt-cdc.pack.gz +56 jogl.core.cdc.pack.gz +20 jogl.egl.cdc.pack.gz +12 jogl.gles1.cdc.pack.gz +44 jogl.util.cdc.pack.gz +12 nativewindow.all.cdc.pack.gz +28 newt.all.cdc.pack.gz +4 libgluegen-rt.so.gz +36 libjogl_es1.so.gz +12 libnewt.so.gz +244 total + +JOGL CDCFP ES2 MOBILE +20 gluegen-rt-cdc.pack.gz +56 jogl.core.cdc.pack.gz +20 jogl.egl.cdc.pack.gz +16 jogl.gles2.cdc.pack.gz +44 jogl.util.cdc.pack.gz +12 nativewindow.all.cdc.pack.gz +28 newt.all.cdc.pack.gz +4 libgluegen-rt.so.gz +36 libjogl_es2.so.gz +12 libnewt.so.gz +248 total + +JOGL GLU +20 jogl.glu.gl2.pack.gz +24 jogl.glu.mipmap.cdc.pack.gz +24 jogl.glu.mipmap.pack.gz +20 jogl.glu.tess.cdc.pack.gz +20 jogl.glu.tess.pack.gz +108 total + +JOGL EVERYTHING +684 jogl.all.pack.gz +20 nativewindow.all.pack.gz +32 newt.all.pack.gz +4 libgluegen-rt.so.gz +8 libnativewindow_x11.so.gz +4 libnativewindow_awt.so.gz +120 libjogl_desktop.so.gz +36 libjogl_es1.so.gz +36 libjogl_es2.so.gz +12 libnewt.so.gz +956 total + diff --git a/doc/userguide/index.html b/doc/userguide/index.html index 64047cf8d..6b4d281bb 100644 --- a/doc/userguide/index.html +++ b/doc/userguide/index.html @@ -209,7 +209,7 @@ as 1.4.2, which is the earliest version of Java supported by JOGL. <P> The JOGLAppletInstaller is distributed inside jogl.jar as a utility -class in com.sun.opengl.util. It requires that the developer host a +class in com.jogamp.opengl.util. It requires that the developer host a local, signed copy of jogl.jar and all of the jogl-natives jars; the certificates must be the same on all of these jars. Note that in the release builds of JOGL all of these jars are signed by Sun diff --git a/doc/wiki/FAQ.xml b/doc/wiki/FAQ.xml index 25c3fe99d..d01413d50 100644 --- a/doc/wiki/FAQ.xml +++ b/doc/wiki/FAQ.xml @@ -86,7 +86,7 @@ and the output is: Detected screen size 1920x1200 GLProfile[GL2ES1/GL2ES12] Entering initialization GLProfile[GL2ES1/GL2ES12] GL Profile: GLProfile[GL2ES1/GL2ES12] - GLProfile[GL2ES1/GL2ES12] GL:com.sun.opengl.impl.gl2es12.GL2ES12Impl@b815859 + GLProfile[GL2ES1/GL2ES12] GL:com.jogamp.opengl.impl.gl2es12.GL2ES12Impl@b815859 GLProfile[GL2ES1/GL2ES12] GL_VERSION=3.0.0 NVIDIA 185.18.14 GLProfile[GL2ES1/GL2ES12] GL_EXTENSIONS: .. @@ -289,13 +289,13 @@ Below you see the invocation of the ES2 RedSquare jogl-demos utilizing multiple * Single thread (Unix, Win32) <pre>java -Djava.awt.headless=true demos.es2.RedSquare -GL2</pre> * Single thread (MacOSX) <pre>java -XstartOnFirstThread -Djava.awt.headless=true demos.es2.RedSquare -GL2</pre> * Multiple threads & windows (Unix, Win32) <pre>java -Djava.awt.headless=true demos.es2.RedSquare -GL2 -GL2 -GL2 -GL2</pre> -* Multiple threads & windows (MacOSX) <pre>java -XstartOnFirstThread -Djava.awt.headless=true com.sun.javafx.newt.util.MainThread demos.es2.RedSquare -GL2 -GL2 -GL2 -GL2</pre> +* Multiple threads & windows (MacOSX) <pre>java -XstartOnFirstThread -Djava.awt.headless=true com.jogamp.newt.util.MainThread demos.es2.RedSquare -GL2 -GL2 -GL2 -GL2</pre> -The serialization of the main Java class through ''com.sun.javafx.newt.util.MainThread'' +The serialization of the main Java class through ''com.jogamp.newt.util.MainThread'' may be used for all platforms, since it only takes effect on ''MacOSX''. This allows you an almost platform independent invocation of your multithreaded Java applications. -On ''MacOSX'', ''com.sun.javafx.newt.util.MainThread'' will occupy the main thread and +On ''MacOSX'', ''com.jogamp.newt.util.MainThread'' will occupy the main thread and serializes all native window related tasks through it. This mechanism is thread safe utilizes reentrant locking. diff --git a/doxygen/doxygen-all-dev.cfg b/doxygen/doxygen-all-dev.cfg index 2425ff403..d047e7182 100644 --- a/doxygen/doxygen-all-dev.cfg +++ b/doxygen/doxygen-all-dev.cfg @@ -465,7 +465,7 @@ INPUT = ../src/newt/classes INPUT += ../build/jogl/gensrc/classes INPUT += ../build/nativewindow/gensrc/classes INPUT += ../build/newt/gensrc/classes -INPUT += ../../gluegen/src/java/com/sun/gluegen/runtime +INPUT += ../../gluegen/src/java/com/jogamp/gluegen/runtime # If the value of the INPUT tag contains directories, you can use the # FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp diff --git a/doxygen/doxygen-all-pub.cfg b/doxygen/doxygen-all-pub.cfg index 8bf4685cb..a94c49fb0 100644 --- a/doxygen/doxygen-all-pub.cfg +++ b/doxygen/doxygen-all-pub.cfg @@ -461,8 +461,8 @@ WARN_LOGFILE = INPUT = ../src/jogl/classes/javax INPUT += ../build-x86_64/jogl/gensrc/classes/javax -INPUT += ../src/jogl/classes/com/sun/opengl/util -INPUT += ../src/newt/classes/com/sun/javafx/newt +INPUT += ../src/jogl/classes/com/jogamp/opengl/util +INPUT += ../src/newt/classes/com/jogamp/newt # If the value of the INPUT tag contains directories, you can use the # FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp diff --git a/etc/profile.jogl b/etc/profile.jogl index f42a2504b..025b74dd8 100755 --- a/etc/profile.jogl +++ b/etc/profile.jogl @@ -2,7 +2,7 @@ function print_usage() { - echo "Usage: $0 {JOGL_ALL|JOGL_ALL_NOAWT|JOGL_ES1_MIN|JOGL_ES1_MAX|JOGL_ES2_MIN|JOGL_ES2_MAX|JOGL_GL2ES12_MIN|JOGL_GL2ES12_MAX|JOGL_GL2_MIN|JOGL_GL2_MAX} [jogl-build-dir]" + echo "Usage: $0 {JOGL_ALL|JOGL_ALL_NOAWT|JOGL_ES1_MIN|JOGL_ES1_MAX|JOGL_ES2_MIN|JOGL_ES2_MAX|JOGL_GL2ES12_MIN|JOGL_GL2ES12_MAX|JOGL_GLDESKTOP_MIN|JOGL_GLDESKTOP_MAX} [jogl-build-dir]" } function concat_jogl_list() @@ -28,11 +28,13 @@ uname -a | grep -i Darwin && OSS=osx JOGL_AWT="jogl.awt.jar jogl.util.awt.jar newt.awt.jar nativewindow.awt.jar" -JOGL_CORE="nativewindow.core.jar nativewindow.x11.jar jogl.core.jar newt.core.jar newt.$OSS.jar newt.ogl.jar jogl.util.jar" +JOGL_CORE="nativewindow.core.jar nativewindow.os.$OSS.jar jogl.core.jar jogl.os.$OSS.jar newt.core.jar newt.os.$OSS.jar newt.ogl.jar jogl.util.jar" -JOGL_JAR_ALL_NOAWT="$JOGL_CORE jogl.gles1.jar jogl.gles1.dbg.jar jogl.gles2.jar jogl.gles2.dbg.jar jogl.egl.jar jogl.gl2es12.$OSS.jar jogl.gl2.$OSS.jar jogl.gl2.dbg.jar jogl.util.gl2.jar jogl.glu.tess.jar jogl.glu.mipmap.jar jogl.glu.gl2.jar jogl.util.gl2.jar jogl.util.fixedfuncemu.jar jogl.cg.jar" +JOGL_TEST="jogl.test.jar" + +JOGL_JAR_ALL_NOAWT="$JOGL_CORE jogl.gles1.jar jogl.gles1.dbg.jar jogl.gles2.jar jogl.gles2.dbg.jar jogl.egl.jar jogl.os.$OSS.jar jogl.gl2es12.jar jogl.gldesktop.jar jogl.gldesktop.dbg.jar jogl.util.gldesktop.jar jogl.glu.tess.jar jogl.glu.mipmap.jar jogl.glu.gldesktop.jar jogl.util.gldesktop.jar jogl.util.fixedfuncemu.jar jogl.cg.jar" JOGL_JAR_ALL="$JOGL_JAR_ALL_NOAWT $JOGL_AWT" -JOGL_LIB_ALL="libjogl_gl2.so libjogl_es1.so libjogl_es2.so libnewt.so libjogl_awt.so" +JOGL_LIB_ALL="libjogl_desktop.so libjogl_es1.so libjogl_es2.so libnewt.so libjogl_awt.so" JOGL_JAR_ES1_MIN="$JOGL_CORE jogl.gles1.jar jogl.gles1.dbg.jar jogl.egl.jar" JOGL_JAR_ES1_MAX="$JOGL_CORE jogl.gles1.jar jogl.gles1.dbg.jar jogl.egl.jar jogl.glu.tess.jar jogl.glu.mipmap.jar $JOGL_AWT" @@ -44,18 +46,18 @@ JOGL_JAR_ES2_MAX="$JOGL_CORE jogl.gles2.jar jogl.gles2.dbg.jar jogl.egl.jar jogl JOGL_LIB_ES2_MIN="libjogl_es2.so libnewt.so" JOGL_LIB_ES2_MAX="libjogl_es2.so libnewt.so libjogl_awt.so libnativewindow_x11.so libnativewindow_awt.so" -JOGL_JAR_GL2ES12_MIN="$JOGL_CORE jogl.gl2es12.$OSS.jar jogl.gles1.dbg.jar jogl.gles2.dbg.jar jogl.util.fixedfuncemu.jar" -JOGL_JAR_GL2ES12_MAX="$JOGL_CORE jogl.gl2es12.$OSS.jar jogl.gles1.dbg.jar jogl.gles2.dbg.jar jogl.util.fixedfuncemu.jar jogl.gl2es12.dbg.jar jogl.glu.tess.jar jogl.glu.mipmap.jar $JOGL_AWT" +JOGL_JAR_GL2ES12_MIN="$JOGL_CORE jogl.os.$OSS.jar jogl.gl2es12.jar jogl.gles1.dbg.jar jogl.gles2.dbg.jar jogl.util.fixedfuncemu.jar" +JOGL_JAR_GL2ES12_MAX="$JOGL_CORE jogl.os.$OSS.jar jogl.gl2es12.jar jogl.gles1.dbg.jar jogl.gles2.dbg.jar jogl.util.fixedfuncemu.jar jogl.gl2es12.dbg.jar jogl.glu.tess.jar jogl.glu.mipmap.jar $JOGL_AWT" JOGL_LIB_GL2ES12_MIN="libjogl_gl2es12.so libnewt.so libnativewindow_x11.so libnativewindow_awt.so" JOGL_LIB_GL2ES12_MAX="libjogl_gl2es12.so libnewt.so libnativewindow_x11.so libnativewindow_awt.so" -JOGL_JAR_GL2_MIN="$JOGL_CORE jogl.gl2.$OSS.jar jogl.gl2.dbg.jar" -JOGL_JAR_GL2_MAX="$JOGL_CORE jogl.gl2.$OSS.jar jogl.gl2.dbg.jar jogl.glu.tess.jar jogl.glu.mipmap.jar jogl.glu.gl2.jar jogl.util.gl2.jar $JOGL_AWT jogl.cg.jar" -JOGL_LIB_GL2_MIN="libjogl_gl2.so libnewt.so libnativewindow_x11.so libnativewindow_awt.so" -JOGL_LIB_GL2_MAX="libjogl_gl2.so libnewt.so libnativewindow_x11.so libnativewindow_awt.so" +JOGL_JAR_GLDESKTOP_MIN="$JOGL_CORE jogl.os.$OSS.jar jogl.gldesktop.jar jogl.gldesktop.dbg.jar" +JOGL_JAR_GLDESKTOP_MAX="$JOGL_CORE jogl.os.$OSS.jar jogl.gldesktop.jar jogl.gldesktop.dbg.jar jogl.glu.tess.jar jogl.glu.mipmap.jar jogl.glu.gldesktop.jar jogl.util.gldesktop.jar $JOGL_AWT jogl.cg.jar" +JOGL_LIB_GLDESKTOP_MIN="libjogl_desktop.so libnewt.so libnativewindow_x11.so libnativewindow_awt.so" +JOGL_LIB_GLDESKTOP_MAX="libjogl_desktop.so libnewt.so libnativewindow_x11.so libnativewindow_awt.so" -export JOGL_JAR_ALL JOGL_JAR_ALL_NOAWT JOGL_JAR_ES1_MIN JOGL_JAR_ES1_MAX JOGL_JAR_ES2_MIN JOGL_JAR_ES2_MAX JOGL_JAR_GL2ES12_MIN JOGL_JAR_GL2ES12_MAX JOGL_JAR_GL2_MIN JOGL_JAR_GL2_MAX -export JOGL_LIB_ALL JOGL_LIB_ES1_MIN JOGL_LIB_ES1_MAX JOGL_LIB_ES2_MIN JOGL_LIB_ES2_MAX JOGL_LIB_GL2ES12_MIN JOGL_LIB_GL2ES12_MAX JOGL_LIB_GL2_MIN JOGL_LIB_GL2_MAX +export JOGL_JAR_ALL JOGL_JAR_ALL_NOAWT JOGL_JAR_ES1_MIN JOGL_JAR_ES1_MAX JOGL_JAR_ES2_MIN JOGL_JAR_ES2_MAX JOGL_JAR_GL2ES12_MIN JOGL_JAR_GL2ES12_MAX JOGL_JAR_GLDESKTOP_MIN JOGL_JAR_GLDESKTOP_MAX +export JOGL_LIB_ALL JOGL_LIB_ES1_MIN JOGL_LIB_ES1_MAX JOGL_LIB_ES2_MIN JOGL_LIB_ES2_MAX JOGL_LIB_GL2ES12_MIN JOGL_LIB_GL2ES12_MAX JOGL_LIB_GLDESKTOP_MIN JOGL_LIB_GLDESKTOP_MAX THISDIR=`dirname $0` @@ -96,7 +98,7 @@ export JOGL_LIB_DIR if [ ! -z "$JOGL_PROFILE" ] ; then case "$JOGL_PROFILE" in JOGL_ALL) - JOGL_CLASSPATH=$(concat_jogl_list $JOGL_BUILD_DIR $JOGL_JAR_ALL) + JOGL_CLASSPATH=$(concat_jogl_list $JOGL_BUILD_DIR $JOGL_JAR_ALL $JOGL_TEST) ;; JOGL_ALL_NOAWT) JOGL_CLASSPATH=$(concat_jogl_list $JOGL_BUILD_DIR $JOGL_JAR_ALL_NOAWT) @@ -123,11 +125,11 @@ if [ ! -z "$JOGL_PROFILE" ] ; then JOGL_GL2ES12_MAX) JOGL_CLASSPATH=$(concat_jogl_list $JOGL_BUILD_DIR $JOGL_JAR_GL2ES12_MAX) ;; - JOGL_GL2_MIN) - JOGL_CLASSPATH=$(concat_jogl_list $JOGL_BUILD_DIR $JOGL_JAR_GL2_MIN) + JOGL_GLDESKTOP_MIN) + JOGL_CLASSPATH=$(concat_jogl_list $JOGL_BUILD_DIR $JOGL_JAR_GLDESKTOP_MIN) ;; - JOGL_GL2_MAX) - JOGL_CLASSPATH=$(concat_jogl_list $JOGL_BUILD_DIR $JOGL_JAR_GL2_MAX) + JOGL_GLDESKTOP_MAX) + JOGL_CLASSPATH=$(concat_jogl_list $JOGL_BUILD_DIR $JOGL_JAR_GLDESKTOP_MAX) ;; esac diff --git a/jnlp-files/jogl-all-awt.jnlp b/jnlp-files/jogl-all-awt.jnlp index 125980882..718d09da7 100644 --- a/jnlp-files/jogl-all-awt.jnlp +++ b/jnlp-files/jogl-all-awt.jnlp @@ -9,6 +9,7 @@ <description kind="short">Java programming language binding for the OpenGL 3D graphics API - ALL.AWT</description> <offline-allowed/> </information> + <update check="background" policy="always"/> <security> <all-permissions/> </security> diff --git a/jnlp-files/jogl-all-noawt.jnlp b/jnlp-files/jogl-all-noawt.jnlp index 7159ba8e7..3e4536dc5 100644 --- a/jnlp-files/jogl-all-noawt.jnlp +++ b/jnlp-files/jogl-all-noawt.jnlp @@ -9,6 +9,7 @@ <description kind="short">Java programming language binding for the OpenGL 3D graphics API - ALL.NO_AWT</description> <offline-allowed/> </information> + <update check="background" policy="always"/> <security> <all-permissions/> </security> diff --git a/jnlp-files/jogl-awt.jnlp b/jnlp-files/jogl-awt.jnlp index 03c61b37a..3e823ce50 100644 --- a/jnlp-files/jogl-awt.jnlp +++ b/jnlp-files/jogl-awt.jnlp @@ -9,6 +9,7 @@ <description kind="short">Java programming language binding for the OpenGL 3D graphics API - AWT.</description> <offline-allowed/> </information> + <update check="background" policy="always"/> <security> <all-permissions/> </security> diff --git a/jnlp-files/jogl-core.jnlp b/jnlp-files/jogl-core.jnlp index c1dbcfc1d..05ea506e4 100644 --- a/jnlp-files/jogl-core.jnlp +++ b/jnlp-files/jogl-core.jnlp @@ -9,6 +9,7 @@ <description kind="short">Java programming language binding for the OpenGL 3D graphics API - CORE.</description> <offline-allowed/> </information> + <update check="background" policy="always"/> <security> <all-permissions/> </security> diff --git a/jnlp-files/jogl-gl2es12.jnlp b/jnlp-files/jogl-gl2es12.jnlp index 25402adcb..4a2c8502d 100644 --- a/jnlp-files/jogl-gl2es12.jnlp +++ b/jnlp-files/jogl-gl2es12.jnlp @@ -9,6 +9,7 @@ <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> diff --git a/jnlp-files/nativewindow-all-awt.jnlp b/jnlp-files/nativewindow-all-awt.jnlp index f22166ecb..34edf4a1f 100644 --- a/jnlp-files/nativewindow-all-awt.jnlp +++ b/jnlp-files/nativewindow-all-awt.jnlp @@ -9,6 +9,7 @@ <description kind="short">Java API for a binding to a native windowing system - 2.0 - ALL.AWT</description> <offline-allowed/> </information> + <update check="background" policy="always"/> <security> <all-permissions/> </security> diff --git a/jnlp-files/nativewindow-awt.jnlp b/jnlp-files/nativewindow-awt.jnlp index aa07c3a24..1cc1a62be 100644 --- a/jnlp-files/nativewindow-awt.jnlp +++ b/jnlp-files/nativewindow-awt.jnlp @@ -9,6 +9,7 @@ <description kind="short">Java API for a binding to a native windowing system - 2.0 - AWT</description> <offline-allowed/> </information> + <update check="background" policy="always"/> <security> <all-permissions/> </security> diff --git a/jnlp-files/nativewindow.jnlp b/jnlp-files/nativewindow.jnlp index 60a07aede..b8ed6f36f 100644 --- a/jnlp-files/nativewindow.jnlp +++ b/jnlp-files/nativewindow.jnlp @@ -9,6 +9,7 @@ <description kind="short">Java API for a binding to a native windowing system - 2.0 - CORE</description> <offline-allowed/> </information> + <update check="background" policy="always"/> <security> <all-permissions/> </security> diff --git a/jnlp-files/newt-all-awt.jnlp b/jnlp-files/newt-all-awt.jnlp index 7378e8ca2..24183b9e2 100644 --- a/jnlp-files/newt-all-awt.jnlp +++ b/jnlp-files/newt-all-awt.jnlp @@ -9,6 +9,7 @@ <description kind="short">NEWT - A NativeWindow Interface implementation - ALL.AWT</description> <offline-allowed/> </information> + <update check="background" policy="always"/> <security> <all-permissions/> </security> diff --git a/jnlp-files/newt-all-noawt.jnlp b/jnlp-files/newt-all-noawt.jnlp index 752d96add..36f437296 100644 --- a/jnlp-files/newt-all-noawt.jnlp +++ b/jnlp-files/newt-all-noawt.jnlp @@ -9,6 +9,7 @@ <description kind="short">NEWT - A NativeWindow Interface implementation - ALL.NO_AWT</description> <offline-allowed/> </information> + <update check="background" policy="always"/> <security> <all-permissions/> </security> diff --git a/jnlp-files/newt-awt.jnlp b/jnlp-files/newt-awt.jnlp index 28bb8e706..f4cd0799e 100644 --- a/jnlp-files/newt-awt.jnlp +++ b/jnlp-files/newt-awt.jnlp @@ -9,6 +9,7 @@ <description kind="short">NEWT - A NativeWindow Interface implementation - AWT</description> <offline-allowed/> </information> + <update check="background" policy="always"/> <security> <all-permissions/> </security> diff --git a/jnlp-files/newt-jogl.jnlp b/jnlp-files/newt-jogl.jnlp index 1ac69781a..bd8d8a675 100644 --- a/jnlp-files/newt-jogl.jnlp +++ b/jnlp-files/newt-jogl.jnlp @@ -9,6 +9,7 @@ <description kind="short">NEWT - A NativeWindow Interface implementation - JOGL</description> <offline-allowed/> </information> + <update check="background" policy="always"/> <security> <all-permissions/> </security> diff --git a/jnlp-files/newt.jnlp b/jnlp-files/newt.jnlp index cb6899256..71eb9952d 100644 --- a/jnlp-files/newt.jnlp +++ b/jnlp-files/newt.jnlp @@ -9,6 +9,7 @@ <description kind="short">NEWT - A NativeWindow Interface implementation - CORE</description> <offline-allowed/> </information> + <update check="background" policy="always"/> <security> <all-permissions/> </security> diff --git a/jogl.iml b/jogl.iml new file mode 100644 index 000000000..419fbc916 --- /dev/null +++ b/jogl.iml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<module type="JAVA_MODULE" version="4"> + <component name="NewModuleRootManager" inherit-compiler-output="true"> + <exclude-output /> + <content url="file://$MODULE_DIR$"> + <sourceFolder url="file://$MODULE_DIR$/src/jogl/classes" isTestSource="false" /> + <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" /> + <orderEntry type="sourceFolder" forTests="false" /> + <orderEntry type="module" module-name="gluegen" /> + <orderEntry type="library" name="junit" level="application" /> + </component> +</module> + diff --git a/make/build-common.xml b/make/build-common.xml new file mode 100644 index 000000000..cc40a5cd4 --- /dev/null +++ b/make/build-common.xml @@ -0,0 +1,345 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<project name="JOGLCommonStuff" basedir="." default="common.init"> + + <description>Common JOGL Stuff</description> + + <fail message="Please build using Ant 1.8.0 or higher."> + <condition> + <not> + <antversion atleast="1.8.0"/> + </not> + </condition> + </fail> + + <!-- Pull in GlueGen cpptasks build file --> + <property name="gluegen.root" value="../../gluegen" /> + <import file="${gluegen.root}/make/gluegen-cpptasks.xml" /> + + <property name="ant-contrib.jar" value="${gluegen.root}/make/lib/ant-contrib-1.0b3.jar" /> + + <condition property="rootrel.build" value="build"> + <not> + <isset property="rootrel.build"/> + </not> + </condition> + + <import file="versions.xml" /> + + <tstamp> + <format property="version.timestamp" pattern="yyyyMMdd"/> + </tstamp> + + <target name="nativewindow.setup-version-RI" if="nativewindow.ri"> + <property name="nativewindow.version" value="${nativewindow_base_version}" /> + </target> + + <target name="nativewindow.setup-version-non-RI" unless="nativewindow.ri"> + <property name="nativewindow.version" value="${nativewindow_base_version}-pre-${version.timestamp}" /> + </target> + <target name="jogl.setup-version-RI" if="jogl.ri"> + <property name="jogl.version" value="${jogl_base_version}" /> + </target> + + <target name="jogl.setup-version-non-RI" unless="jogl.ri"> + <property name="jogl.version" value="${jogl_base_version}-pre-${version.timestamp}" /> + </target> + + <target name="newt.setup-version-RI" if="newt.ri"> + <property name="newt.version" value="${newt_base_version}" /> + </target> + + <target name="newt.setup-version-non-RI" unless="newt.ri"> + <property name="newt.version" value="${newt_base_version}-pre-${version.timestamp}" /> + </target> + + <target name="setup-versions" depends="nativewindow.setup-version-RI, nativewindow.setup-version-non-RI, jogl.setup-version-RI, jogl.setup-version-non-RI, newt.setup-version-RI, newt.setup-version-non-RI"/> + + <!-- ================================================================== --> + <!-- + - Base initialization of properties and detection of operating system. + --> + <target name="common.init" depends="gluegen.cpptasks.detect.os,setup-versions" unless="common.init.done"> + <property name="common.init.done" value="true" /> + + <!-- Set the project root directory to be up one directory. --> + <property name="project.root" value=".." /> + <property name="build" value="${project.root}/${rootrel.build}" /> + <property name="src" value="${project.root}/src" /> + <property name="lib" value="${build}/lib" /> + + <property name="archive.name" value="jogl-${jogl.version}-${os.and.arch}" /> + <property name="archive" value="${build}/${archive.name}" /> + + <property name="all.srcj.path" value="${src}/nativewindow/classes;${src}/jogl/classes;${src}/newt/classes" /> + <!-- No generated classes for Newt at the present time --> + <property name="all.genj.path" value="${build}/nativewindow/gensrc/classes;${build}/jogl/gensrc/classes" /> + + <!-- Set the configuration and build files to this directory. --> + <property name="make" value="." /> + <property name="config" value="${make}/config" /> + <property name="stub.includes" value="stub_includes" /> <!-- NOTE: this MUST be relative for FileSet --> + <property name="stub.includes.common" value="${stub.includes}/common" /> + + <condition property="setup.nodesktop"> + <and> + <isfalse value="${isWindows}" /> + <isfalse value="${isOSX}" /> + <isfalse value="${isX11}" /> + </and> + </condition> + + <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 + - exist. --> + <property name="user.properties.file" value="${user.home}/jogl.properties" /> + <property file="${user.properties.file}" /> + <echo message="Loaded ${user.properties.file}." /> + <property file="${user.home}/gluegen.properties" /> + <echo message="Loaded ${user.home}/gluegen.properties." /> + <fail message="antlr.jar was not specified in jogl.properties or gluegen.properties. Please see README.txt for instructions" unless="antlr.jar"/> + <echo message="antlr.jar=${antlr.jar}" /> + + <property name="target.sourcelevel" value="1.4" /> + <property name="host.sourcelevel" value="1.5" /> + + <!-- 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" /> + <!-- property name="javac.memorymax" value="128m" /--> <!-- I ran out of memory with these .. linux x86_64 6u14 --> + <property name="javac.memorymax" value="512m" /> + + <!-- Names of directories relative to the project root. + Some of these are used in FileMappers later for dependence information + 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" /> + <property name="gluegen.build.xml" value="${gluegen.make}/build.xml" /> + <property name="build.gluegen" value="${gluegen.root}/${rootrel.build}" /> + <property name="obj.gluegen" value="${build.gluegen}/obj"/> + <property name="gluegen.jar" value="${build.gluegen}/gluegen.jar" /> + <property name="junit.jar" value="${gluegen.make}/lib/junit-4.5.jar" /> + <property name="ant.jar" value="${ant.home}/lib/ant.jar" /> + <property name="ant-junit.jar" value="${ant.home}/lib/ant-junit.jar" /> + + <property name="nativewindow.make" value="." /> + <property name="nativewindow.build.xml" value="${nativewindow.make}/build-nativewindow.xml" /> + <property name="build.nativewindow" value="${build}/nativewindow" /> + <property name="obj.nativewindow" value="${build.nativewindow}/obj"/> + + <property name="jogl.make" value="." /> + <property name="jogl.build.xml" value="${jogl.make}/build-jogl.xml" /> + <property name="build.jogl" value="${build}/jogl" /> + <property name="obj.jogl" value="${build.jogl}/obj"/> + + <property name="newt.make" value="." /> + <property name="newt.build.xml" value="${newt.make}/build-newt.xml" /> + <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="obj.all.paths" value="${obj.gluegen}${path.separator}${obj.nativewindow}${path.separator}${obj.jogl}${path.separator}${obj.newt}${path.separator}${obj.junit}" /> + + <path id="gluegen.classpath"> + <pathelement location="${gluegen.jar}" /> + <pathelement location="${antlr.jar}" /> + </path> + + <!-- JavaSE combinations --> + <property name="gluegen-rt.jar" value="${build.gluegen}/gluegen-rt.jar" /> + <property name="jogl.test.jar" value="${build.jogl}/jogl.test.jar"/> + + <!-- JavaSE combinations . AWT --> + <property name="nativewindow.all.jar" value="${build.nativewindow}/nativewindow.all.jar" /> + <property name="jogl.all.jar" value="${build.jogl}/jogl.all.jar" /> + <property name="newt.all.jar" value="${build.newt}/newt.all.jar" /> + + <path id="nativewindow_gluegen.classpath"> + <pathelement location="${gluegen-rt.jar}" /> + <pathelement location="${nativewindow.all.jar}" /> + </path> + + <path id="nativewindow_gluegen_jogl.classpath"> + <pathelement location="${gluegen-rt.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="${nativewindow.all.jar}" /> + <pathelement location="${jogl.all.jar}" /> + <pathelement location="${newt.all.jar}" /> + </path> + + <path id="junit_jogl_newt.compile.classpath"> + <pathelement location="${junit.jar}" /> + <pathelement location="${ant.jar}" /> + <pathelement location="${ant-junit.jar}" /> + <pathelement location="${gluegen-rt.jar}" /> + <pathelement location="${nativewindow.all.jar}" /> + <pathelement location="${jogl.all.jar}" /> + <pathelement location="${newt.all.jar}" /> + </path> + + <path id="junit_jogl_newt.run.classpath"> + <pathelement location="${junit.jar}" /> + <pathelement location="${ant.jar}" /> + <pathelement location="${ant-junit.jar}" /> + <pathelement location="${gluegen-rt.jar}" /> + <pathelement location="${nativewindow.all.jar}" /> + <pathelement location="${jogl.all.jar}" /> + <pathelement location="${newt.all.jar}" /> + <pathelement location="${jogl.test.jar}" /> + </path> + <property name="junit_jogl_newt.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}"/> + + <!-- JavaSE combinations . NO.AWT --> + <property name="nativewindow.all-noawt.jar" value="${build.nativewindow}/nativewindow.all-noawt.jar" /> + <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="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="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="jogl.core.jar" value="${build.jogl}/jogl.core.jar" /> + <property name="jogl.cg.jar" value="${build.jogl}/jogl.cg.jar" /> + <property name="jogl.gles1.jar" value="${build.jogl}/jogl.gles1.jar" /> + <property name="jogl.gles1.dbg.jar" value="${build.jogl}/jogl.gles1.dbg.jar" /> + <property name="jogl.gles2.jar" value="${build.jogl}/jogl.gles2.jar" /> + <property name="jogl.gles2.dbg.jar" value="${build.jogl}/jogl.gles2.dbg.jar" /> + <property name="jogl.egl.jar" value="${build.jogl}/jogl.egl.jar" /> + <property name="jogl.glutess.jar" value="${build.jogl}/jogl.glu.tess.jar" /> + <property name="jogl.glumipmap.jar" value="${build.jogl}/jogl.glu.mipmap.jar" /> + <property name="jogl.glugldesktop.jar" value="${build.jogl}/jogl.glu.gldesktop.jar" /> + + <property name="jogl.os.x11.jar" value="${build.jogl}/jogl.os.x11.jar" /> + <property name="jogl.os.win.jar" value="${build.jogl}/jogl.os.win.jar" /> + <property name="jogl.os.osx.jar" value="${build.jogl}/jogl.os.osx.jar" /> + + <property name="jogl.gl2es12.jar" value="${build.jogl}/jogl.gl2es12.jar" /> + + <property name="jogl.gldesktop.jar" value="${build.jogl}/jogl.gldesktop.jar" /> + <property name="jogl.gldesktop.dbg.jar" value="${build.jogl}/jogl.gldesktop.dbg.jar" /> + + <property name="jogl.omx.jar" value="${build.jogl}/jogl.omx.jar" /> + + <property name="jogl.awt.jar" value="${build.jogl}/jogl.awt.jar" /> + <property name="jogl.util.jar" value="${build.jogl}/jogl.util.jar" /> + <property name="jogl.util.gldesktop.jar" value="${build.jogl}/jogl.util.gldesktop.jar" /> + <property name="jogl.util.awt.jar" value="${build.jogl}/jogl.util.awt.jar" /> + <property name="jogl.util.fixedfuncemu.jar" value="${build.jogl}/jogl.util.fixedfuncemu.jar" /> + <property name="jogl.sdk.jar" value="${build.jogl}/jogl.sdk.jar" /> + + <property name="newt.core.jar" value="${build.newt}/newt.core.jar" /> + <property name="newt.os.x11.jar" value="${build.newt}/newt.os.x11.jar" /> + <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.awt.jar" value="${build.newt}/newt.awt.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="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.gl2es12.cdc.jar" value="${build.jogl}/jogl.gl2es12.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" /> + + <!-- The location and name of the configuration ANT file that will + - validate to ensure that all user-define variables are set. --> + <property name="validate.user.properties" value="${make}/validate-properties.xml" /> + </target> + + <!-- ================================================================== --> + <!-- GlueGen and BuildStaticGLInfo creation, task setup and Java file generation --> + <!-- + - Build GlueGen + --> + <target name="common.gluegen.build" depends="common.init" unless="common.gluegen.build.done"> + <property name="common.gluegen.build.done" value="true" /> + + <!-- 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> + </target> + + +</project> diff --git a/make/build-gluegen.xml b/make/build-gluegen.xml index 992599cdb..fedfd9d93 100644 --- a/make/build-gluegen.xml +++ b/make/build-gluegen.xml @@ -88,6 +88,7 @@ - NOTE: GlueGenTask is NOT built at this time. It is done in - a separate task. --> <javac destdir="${classes}" includes="**/gluegen/**" excludes="**/GlueGenTask.java" + includeAntRuntime="false" source="1.4" debug="true" debuglevel="source,lines"> <src path="${src.java}" /> <src path="${src.generated.java}" /> @@ -140,7 +141,8 @@ <!-- Build the GlueGen ANT task. - NOTE: ONLY the GlueGenTask is built at this time. GlueGen - itself is built in a separate task. --> - <javac destdir="${classes}" includes="**/GlueGenTask.java" source="1.4" debug="true" debuglevel="source,lines"> + <javac destdir="${classes}" includes="**/GlueGenTask.java" source="1.4" debug="true" debuglevel="source,lines" + includeAntRuntime="false"> <src path="${src.java}" /> <classpath refid="antlr.classpath" /> </javac> diff --git a/make/build-jogl.xml b/make/build-jogl.xml index 23ad51a9e..760200398 100644 --- a/make/build-jogl.xml +++ b/make/build-jogl.xml @@ -59,121 +59,92 @@ setup.noAWT setup.noCDC + - Skip gluegen: java.generate.skip --> <project name="JOGL" basedir="." default="all"> - <import file="versions.xml" /> - - <!-- Pull in GlueGen cpptasks build file --> - <property name="gluegen.root" value="../../gluegen" /> - <import file="${gluegen.root}/make/gluegen-cpptasks.xml" /> + <import file="build-common.xml"/> <!-- ================================================================== --> <!-- - Base initialization and detection of operating system. --> - <target name="base.init" depends="gluegen.cpptasks.detect.os"> - - <condition property="setup.nodesktop"> - <and> - <isfalse value="${isWindows}" /> - <isfalse value="${isOSX}" /> - <isfalse value="${isX11}" /> - </and> - </condition> - - <condition property="setup.noall"> - <isset property="setup.noAWT"/> - </condition> - - <echo message="setup.nodesktop: ${setup.nodesktop}" /> - <echo message="setup.noall: ${setup.noall}" /> - <echo message="setup.noAWT: ${setup.noAWT}" /> - <echo message="setup.noCDC: ${setup.noCDC}" /> - - <!-- partitioning --> - + <target name="partitioning.setup" depends="common.init"> <property name="java.part.core" - value="javax/media/opengl/* javax/media/opengl/fixedfunc/* javax/media/opengl/glu/* javax/media/opengl/glu/gl2es1/* com/sun/opengl/impl/* com/sun/opengl/impl/glu/* com/sun/opengl/impl/glu/error/*"/> + value="javax/media/opengl/* javax/media/opengl/fixedfunc/* javax/media/opengl/glu/* javax/media/opengl/glu/gl2es1/* com/jogamp/opengl/impl/* com/jogamp/opengl/impl/glu/* com/jogamp/opengl/impl/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/sun/opengl/cg com/sun/opengl/cg/*"/> + value="com/jogamp/opengl/cg com/jogamp/opengl/cg/*"/> <property name="java.part.egl" - value="com/sun/opengl/impl/egl/*"/> + value="com/jogamp/opengl/impl/egl/*"/> <property name="java.part.glutess" - value="com/sun/opengl/impl/glu/tessellator/**"/> + value="com/jogamp/opengl/impl/glu/tessellator/**"/> <property name="java.part.glumipmap" - value="com/sun/opengl/impl/glu/mipmap/**"/> + value="com/jogamp/opengl/impl/glu/mipmap/**"/> - <property name="java.part.glugl2" - value="com/sun/opengl/impl/glu/gl2/** com/sun/opengl/impl/glu/nurbs/** com/sun/opengl/impl/glu/registry/** javax/media/opengl/glu/gl2/**"/> + <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/**"/> <property name="java.part.openmax" - value="com/sun/openmax/**"/> + value="com/jogamp/openmax/**"/> <property name="java.part.sdk" - value="com/sun/opengl/util/glsl/sdk/**"/> + value="com/jogamp/opengl/util/glsl/sdk/**"/> <property name="java.part.glx" - value="com/sun/opengl/impl/x11/glx/*"/> + value="com/jogamp/opengl/impl/x11/glx/*"/> <property name="java.part.wgl" - value="com/sun/opengl/impl/windows/wgl/*"/> + value="com/jogamp/opengl/impl/windows/wgl/*"/> <property name="java.part.cgl" - value="com/sun/opengl/impl/macosx/cgl/*"/> + value="com/jogamp/opengl/impl/macosx/cgl/*"/> <property name="java.part.gl2es12" - value="com/sun/opengl/impl/gl2es12/**"/> + value="com/jogamp/opengl/impl/gl2es12/**"/> - <property name="java.part.gl3" - value="com/sun/opengl/impl/**/gl3/**"/> + <property name="java.part.gldesktop" + value="com/jogamp/opengl/impl/**/gl2/** com/jogamp/opengl/impl/**/gl3/** com/jogamp/opengl/impl/**/gl4/**"/> - <property name="java.part.gl3.dbg" - value="javax/media/opengl/TraceGL3.* javax/media/opengl/DebugGL3.* javax/media/opengl/TraceGL3bc.* javax/media/opengl/DebugGL3bc.*"/> - - <property name="java.part.gl2" - value="com/sun/opengl/impl/**/gl2/**"/> - - <property name="java.part.gl2.dbg" - value="javax/media/opengl/TraceGL2.* javax/media/opengl/DebugGL2.* javax/media/opengl/TraceGL2GL3.* javax/media/opengl/DebugGL2GL3.*"/> + <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/sun/opengl/**/es1/**"/> + value="javax/media/opengl/**/es1/** com/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/sun/opengl/**/es2/**"/> + value="javax/media/opengl/**/es2/** com/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/sun/opengl/impl/**/awt/**"/> + value="javax/media/opengl/awt/** com/jogamp/opengl/impl/**/awt/**"/> <property name="java.part.util" - value="com/sun/opengl/util/* com/sun/opengl/util/texture/** com/sun/opengl/util/packrect/**"/> + value="com/jogamp/opengl/util/* com/jogamp/opengl/util/texture/** com/jogamp/opengl/util/packrect/**"/> <property name="java.part.util.awt" - value="com/sun/opengl/util/**/awt/** com/sun/opengl/util/AWTAnimatorImpl*"/> + value="com/jogamp/opengl/util/**/awt/** com/jogamp/opengl/util/AWTAnimatorImpl*"/> - <property name="java.part.util.gl2" - value="com/sun/opengl/util/**/gl2/**"/> + <property name="java.part.util.gldesktop" + value="com/jogamp/opengl/util/**/gl2/**"/> <property name="java.part.util.glsl" - value="com/sun/opengl/util/glsl/* com/sun/opengl/util/glsl/fixedfunc/*"/> + value="com/jogamp/opengl/util/glsl/* com/jogamp/opengl/util/glsl/fixedfunc/*"/> <property name="java.part.util.fixedfuncemu" - value="com/sun/opengl/util/glsl/fixedfunc/impl/**"/> + value="com/jogamp/opengl/util/glsl/fixedfunc/impl/**"/> <property name="java.part.util.fixedfuncemu.shadercode" - value="com/sun/opengl/util/glsl/fixedfunc/impl/shaders/* com/sun/opengl/util/glsl/fixedfunc/impl/shaders/bin/**"/> + value="com/jogamp/opengl/util/glsl/fixedfunc/impl/shaders/* com/jogamp/opengl/util/glsl/fixedfunc/impl/shaders/bin/**"/> <!-- condition excludes --> @@ -190,13 +161,13 @@ </condition> <property name="java.excludes.javadoc.packagenames" - value="com.sun.opengl.impl.gl2.fixme.*,com.sun.javafx.audio.windows.waveout.TestSpatialization"/> + value="com.jogamp.opengl.impl.gl2.fixme.*,com.jogamp.audio.windows.waveout.TestSpatialization"/> <property name="java.excludes.fixme" - value="com/sun/opengl/impl/gl2/fixme/** com/sun/javafx/audio/windows/waveout/TestSpatialization.java" /> + value="com/jogamp/opengl/impl/gl2/fixme/** com/jogamp/audio/windows/waveout/TestSpatialization.java" /> <property name="java.excludes.cdcfp" - value="${java.excludes.fixme} ${java.part.nv-cg} ${java.part.gl2} ${java.part.gl2.dbg} ${java.part.gl3} ${java.part.gl3.dbg} ${java.part.awt} ${java.part.glugl2} ${java.part.util.awt} ${java.part.util.gl2} com/sun/opengl/util/TGAWriter.java"/> + 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"/> <condition property="java.excludes.desktop" value="${java.part.glx} ${java.excludes.cdcfp}"> @@ -205,129 +176,55 @@ <property name="java.excludes.all" value="${java.excludes.fixme} ${java.excludes.nv-cg} ${java.excludes.awt} ${java.excludes.desktop}" /> <echo message="java.excludes.all: ${java.excludes.all}" /> - - <!-- Set the project root directory to be up one directory. --> - <property name="project.root" value=".." /> - - <!-- Set the configuration and build files to this directory. --> - <property name="make" value="." /> - </target> - - <target name="base.init.sourcelevel.1"> - <property name="jogl.sourcelevel" value="1.4" /> - </target> - - <!--target name="base.init.sourcelevel.2" if="gluegen.nsig"> - <property name="jogl.sourcelevel" value="1.5" /> - </target--> - - <!-- ================================================================== --> - <!-- - - Load user properties which override build defaults. - --> - <target name="load.user.properties" depends="base.init,base.init.sourcelevel.1" unless="user.properties.file"> - <!-- Load the user specified properties file that defines various host - - specific paths. The user will be notified if this is does not - - exist. --> - <property name="user.properties.file" value="${user.home}/jogl.properties" /> - <property file="${user.properties.file}" /> - <echo message="Loaded ${user.properties.file}." /> - <property file="${user.home}/gluegen.properties" /> - <echo message="Loaded ${user.home}/gluegen.properties." /> - <fail message="antlr.jar was not specified in jogl.properties or gluegen.properties. Please see README.txt for instructions" unless="antlr.jar"/> - <echo message="antlr.jar=${antlr.jar}" /> </target> <!-- ================================================================== --> <!-- - Declare all paths and user defined variables. --> - <target name="declare.common" description="Declare properties" depends="load.user.properties"> - <!-- The location and name of the configuration ANT file that will - - validate to ensure that all user-define variables are set. --> - <property name="validate.user.properties" value="${make}/validate-properties.xml" /> - - <!-- 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" /> - <!-- property name="javac.memorymax" value="128m" /--> <!-- I ran out of memory with these .. linux x86_64 6u14 --> - <property name="javac.memorymax" value="512m" /> - - <!-- Names of directories relative to the project root. - Some of these are used in FileMappers later for dependence information - and need exact string matching, which is why they use file.separator - instead of "/". --> - <condition property="rootrel.build" value="build"> - <not> - <isset property="rootrel.build"/> - </not> - </condition> - <property name="rootrel.build.jogl" value="${rootrel.build}/jogl" /> - <property name="rootrel.src.java" value="src/jogl/classes" /> - <property name="rootrel.src.c" value="src/jogl/native" /> - <property name="rootrel.src.c.openmax" value="src/jogl/native/openmax" /> + <target name="declare.common" description="Declare properties" depends="partitioning.setup"> + <property name="config.jogl" value="${config}/jogl" /> + + <property name="rootrel.src.java" value="src/jogl/classes" /> + <property name="rootrel.src.c" value="src/jogl/native" /> + <property name="rootrel.src.c.openmax" value="src/jogl/native/openmax" /> - <property name="rootrel.src.generated" value="${rootrel.build.jogl}/gensrc" /> + <property name="rootrel.src.generated" value="${rootrel.build}/jogl/gensrc" /> <property name="rootrel.generated.c.jogl" value="${rootrel.src.generated}/native/jogl" /> - <property name="rootrel.generated.c.cg" value="${rootrel.src.generated}/native/jogl_cg" /> - <property name="rootrel.obj" value="${rootrel.build.jogl}/obj" /> - <property name="rootrel.obj.jogl" value="${rootrel.obj}/jogl" /> - <property name="rootrel.obj.cg" value="${rootrel.obj}/jogl_cg" /> - - <property name="javac.bootclasspath-cdc.jar" value="../../gluegen/make/lib/cdc_fp.jar"/> - - <!-- GlueGen properties. --> - <!-- NOTE that these require a checked-out GlueGen workspace as a --> - <!-- sibling of the JOGL workspace. --> - <property name="gluegen.make.dir" value="../../gluegen/make" /> - <property name="gluegen.build.xml" value="${gluegen.make.dir}/build.xml" /> - <property name="gluegen.jar" value="../../gluegen/${rootrel.build}/gluegen.jar" /> - <property name="gluegen-rt.jar" value="../../gluegen/${rootrel.build}/gluegen-rt.jar" /> - <property name="nativewindow.core.jar" value="../${rootrel.build}/nativewindow/nativewindow.core.jar" /> - <property name="nativewindow.x11.jar" value="../${rootrel.build}/nativewindow/nativewindow.x11.jar" /> - <property name="nativewindow.awt.jar" value="../${rootrel.build}/nativewindow/nativewindow.awt.jar" /> - - <property name="gluegen-rt-cdc.jar" value="../../gluegen/${rootrel.build}/gluegen-rt-cdc.jar" /> - <property name="nativewindow.core.cdc.jar" value="../${rootrel.build}/nativewindow/nativewindow.core.cdc.jar" /> - <property name="nativewindow.x11.cdc.jar" value="../${rootrel.build}/nativewindow/nativewindow.x11.cdc.jar" /> - + <property name="rootrel.generated.c.cg" value="${rootrel.src.generated}/native/jogl_cg" /> + <!-- The source directories. --> <property name="src.java" value="${project.root}/${rootrel.src.java}" /> <property name="src.c" value="${project.root}/${rootrel.src.c}" /> - <property name="build" value="${project.root}/${rootrel.build.jogl}" /> <property name="tempdir" value="${project.root}/build-temp" /> <!-- The generated source directories. --> - <property name="src.generated" value="${build}/gensrc" /> + <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/sun/opengl/cg" /> + <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" /> <property name="src.generated.c.cg" value="${src.generated}/native/jogl_cg" /> <!-- The compiler output directories. --> - <property name="classes" value="${build}/classes" /> - <property name="classes-cdc" value="${build}/classes-cdc" /> - <property name="obj" value="${project.root}/${rootrel.obj}" /> - <property name="obj.jogl" value="${project.root}/${rootrel.obj.jogl}" /> - <property name="obj.cg" value="${project.root}/${rootrel.obj.cg}" /> + <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" /> <!-- The GL headers from which Java files are generated --> - <property name="config" value="${make}/config/jogl" /> - <property name="stub.includes" value="${make}/stub_includes" /> - <property name="stub.includes.dir" value="stub_includes" /> <!-- NOTE: this MUST be relative for FileSet --> - <property name="stub.includes.opengl" value="${stub.includes}/opengl" /> - <property name="stub.includes.common" value="${stub.includes}/common" /> - <dirset id="stub.includes.fileset.all.gl2" dir="."> - <include name="${stub.includes.dir}/opengl/**" /> - <include name="${stub.includes.dir}/macosx/**" /> - <include name="${stub.includes.dir}/win32/**" /> - <include name="${stub.includes.dir}/x11/**" /> - <include name="${stub.includes.dir}/common/**" /> - <include name="${stub.includes.dir}/jni/**" /> + <property name="stub.includes.opengl" value="${stub.includes}/opengl" /> + + <dirset id="stub.includes.fileset.all.gldesktop" dir="."> + <include name="${stub.includes}/opengl/**" /> + <include name="${stub.includes}/macosx/**" /> + <include name="${stub.includes}/win32/**" /> + <include name="${stub.includes}/x11/**" /> + <include name="${stub.includes}/common/**" /> + <include name="${stub.includes}/jni/**" /> </dirset> - <fileset id="stub.includes.dependencies.fileset.1" dir="${stub.includes.dir}"> + <fileset id="stub.includes.dependencies.fileset.1" dir="${stub.includes}"> <include name="opengl/**" /> <include name="macosx/**" /> <include name="win32/**" /> @@ -336,48 +233,27 @@ <include name="jni/**" /> </fileset> <fileset id="stub.includes.dependencies.fileset.2" file="${gluegen.jar}" /> - <fileset id="stub.includes.dependencies.fileset.3" dir="${config}"> + <fileset id="stub.includes.dependencies.fileset.3" dir="${config.jogl}"> <include name="*.cfg" /> <include name="gl*.java" /> <include name="*.c" /> <exclude name="cg-common.cfg" /> </fileset> <dirset id="stub.includes.cg.fileset.all" dir="."> - <include name="${stub.includes.dir}/opengl/**" /> - <include name="${stub.includes.dir}/cg/**" /> - <include name="${stub.includes.dir}/macosx/**" /> - <include name="${stub.includes.dir}/win32/**" /> - <include name="${stub.includes.dir}/x11/**" /> - <include name="${stub.includes.dir}/common/**" /> + <include name="${stub.includes}/opengl/**" /> + <include name="${stub.includes}/cg/**" /> + <include name="${stub.includes}/macosx/**" /> + <include name="${stub.includes}/win32/**" /> + <include name="${stub.includes}/x11/**" /> + <include name="${stub.includes}/common/**" /> </dirset> <fileset id="stub.includes.cg.dependencies.fileset" dir="."> - <include name="${stub.includes.dir}/cg/**" /> - <include name="${config}/cg-common.cfg" /> - <include name="${config}/cg-common-CustomJavaCode.java" /> + <include name="${stub.includes}/cg/**" /> + <include name="${config.jogl}/cg-common.cfg" /> + <include name="${config.jogl}/cg-common-CustomJavaCode.java" /> </fileset> <!-- Create the classpath that includes GlueGen and - - ANTLR. This requires the user-defined "antlr.jar" - - property. --> - <path id="gluegen.classpath"> - <pathelement location="${gluegen.jar}" /> - <pathelement location="${antlr.jar}" /> - </path> - - <path id="nativewindow_gluegen.classpath"> - <pathelement location="${gluegen-rt.jar}" /> - <pathelement location="${nativewindow.core.jar}" /> - <pathelement location="${nativewindow.x11.jar}" /> - <pathelement location="${nativewindow.awt.jar}" /> - </path> - - <path id="nativewindow_gluegen.classpath-cdc"> - <pathelement location="${gluegen-rt-cdc.jar}" /> - <pathelement location="${nativewindow.core.cdc.jar}" /> - <pathelement location="${nativewindow.x11.cdc.jar}" /> - </path> - - <!-- Create the classpath that includes GlueGen and - the current classes for building the composable pipelines. --> <path id="pipeline.classpath"> @@ -385,49 +261,6 @@ <pathelement location="${classes}" /> </path> - <!-- The resulting J2SE jogl.jar. --> - <property name="jogl.core.jar" value="${build}/jogl.core.jar" /> - <property name="jogl.cg.jar" value="${build}/jogl.cg.jar" /> - <property name="jogl.gles1.jar" value="${build}/jogl.gles1.jar" /> - <property name="jogl.gles1.dbg.jar" value="${build}/jogl.gles1.dbg.jar" /> - <property name="jogl.gles2.jar" value="${build}/jogl.gles2.jar" /> - <property name="jogl.gles2.dbg.jar" value="${build}/jogl.gles2.dbg.jar" /> - <property name="jogl.egl.jar" value="${build}/jogl.egl.jar" /> - <property name="jogl.glutess.jar" value="${build}/jogl.glu.tess.jar" /> - <property name="jogl.glumipmap.jar" value="${build}/jogl.glu.mipmap.jar" /> - <property name="jogl.glugl2.jar" value="${build}/jogl.glu.gl2.jar" /> - <property name="jogl.gl2es12.x11.jar" value="${build}/jogl.gl2es12.x11.jar" /> - <property name="jogl.gl2es12.win.jar" value="${build}/jogl.gl2es12.win.jar" /> - <property name="jogl.gl2es12.osx.jar" value="${build}/jogl.gl2es12.osx.jar" /> - <property name="jogl.gl2.x11.jar" value="${build}/jogl.gl2.x11.jar" /> - <property name="jogl.gl2.win.jar" value="${build}/jogl.gl2.win.jar" /> - <property name="jogl.gl2.osx.jar" value="${build}/jogl.gl2.osx.jar" /> - <property name="jogl.gl2.dbg.jar" value="${build}/jogl.gl2.dbg.jar" /> - <property name="jogl.awt.jar" value="${build}/jogl.awt.jar" /> - <property name="jogl.util.jar" value="${build}/jogl.util.jar" /> - <property name="jogl.util.gl2.jar" value="${build}/jogl.util.gl2.jar" /> - <property name="jogl.util.awt.jar" value="${build}/jogl.util.awt.jar" /> - <property name="jogl.util.fixedfuncemu.jar" value="${build}/jogl.util.fixedfuncemu.jar" /> - <property name="jogl.sdk.jar" value="${build}/jogl.sdk.jar" /> - <property name="jogl.all.jar" value="${build}/jogl.all.jar"/> - <property name="jogl.all-noawt.jar" value="${build}/jogl.all-noawt.jar"/> - - <!-- The resulting CDC jogl.jar. --> - <property name="jogl.core.cdc.jar" value="${build}/jogl.core.cdc.jar" /> - <property name="jogl.gles1.cdc.jar" value="${build}/jogl.gles1.cdc.jar" /> - <property name="jogl.gles1.dbg.cdc.jar" value="${build}/jogl.gles1.dbg.cdc.jar" /> - <property name="jogl.gles2.cdc.jar" value="${build}/jogl.gles2.cdc.jar" /> - <property name="jogl.gles2.dbg.cdc.jar" value="${build}/jogl.gles2.dbg.cdc.jar" /> - <property name="jogl.egl.cdc.jar" value="${build}/jogl.egl.cdc.jar" /> - <property name="jogl.glutess.cdc.jar" value="${build}/jogl.glu.tess.cdc.jar" /> - <property name="jogl.glumipmap.cdc.jar" value="${build}/jogl.glu.mipmap.cdc.jar" /> - <property name="jogl.gl2es12.x11.cdc.jar" value="${build}/jogl.gl2es12.x11.cdc.jar" /> - <property name="jogl.gl2es12.win.cdc.jar" value="${build}/jogl.gl2es12.win.cdc.jar" /> - <property name="jogl.gl2es12.osx.cdc.jar" value="${build}/jogl.gl2es12.osx.cdc.jar" /> - <property name="jogl.util.cdc.jar" value="${build}/jogl.util.cdc.jar" /> - <property name="jogl.util.fixedfuncemu.cdc.jar" value="${build}/jogl.util.fixedfuncemu.cdc.jar" /> - <property name="jogl.all.cdc.jar" value="${build}/jogl.all.cdc.jar"/> - <!-- The javadoc dirs. --> <property name="javadoc" value="${project.root}/javadoc_jogl_public" /> <property name="javadoc.spec" value="${project.root}/javadoc_jogl_spec" /> @@ -437,51 +270,45 @@ <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.sun.opengl.util.*" /> + <property name="javadoc.packagenames" value="${javadoc.spec.packagenames},com.jogamp.opengl.util.*" /> - <property name="javadoc.dev.packagenames" value="${javadoc.packagenames},com.sun.opengl.impl.*,com.sun.gluegen,com.sun.gluegen.runtime" /> + <property name="javadoc.dev.packagenames" value="${javadoc.packagenames},com.jogamp.opengl.impl.*,com.sun.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> <target name="declare.gl.gles1"> - <property name="gles1.headers" value="${stub.includes.dir}/opengl/GLES/*.h" /> <!-- NOTE: this MUST be relative for FileSet --> <!-- CHECK: this may need to be pruned for each platform --> + <property name="gles1.headers" value="${stub.includes}/opengl/GLES/*.h" /> <!-- NOTE: this MUST be relative for FileSet --> <!-- CHECK: this may need to be pruned for each platform --> </target> <target name="declare.gl.gles2"> - <property name="gles2.headers" value="${stub.includes.dir}/opengl/GLES2/*.h" /> <!-- NOTE: this MUST be relative for FileSet --> <!-- CHECK: this may need to be pruned for each platform --> + <property name="gles2.headers" value="${stub.includes}/opengl/GLES2/*.h" /> <!-- NOTE: this MUST be relative for FileSet --> <!-- CHECK: this may need to be pruned for each platform --> </target> <target name="declare.gl.gles" depends="declare.gl.gles1, declare.gl.gles2"> <!-- Prepare to build the EGL interface --> - <property name="window.es.cfg" value="${config}/egl.cfg" /> - <property name="window.es.ext.cfg" value="${config}/eglext.cfg" /> + <property name="window.es.cfg" value="${config.jogl}/egl.cfg" /> + <property name="window.es.ext.cfg" value="${config.jogl}/eglext.cfg" /> <property name="window.es.system" value="egl"/> </target> <target name="declare.gl.gl2"> - <property name="gl2.headers" value="${stub.includes.dir}/opengl/GL/*.h" /> <!-- NOTE: this MUST be relative for FileSet --> <!-- CHECK: this may need to be pruned for each platform --> - </target> - - <!-- Declarations that have to come after both the common setup and the GLES tests --> - <target name="declare.common.2"> + <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/sun/opengl/impl/SystemUtil.java.javame_cdc_fp" tofile="${src.generated.java-cdc}/com/sun/opengl/impl/SystemUtil.java" /> - <copy file="../src/jogl/classes/com/sun/opengl/util/BufferUtil.java.javame_cdc_fp" tofile="${src.generated.java-cdc}/com/sun/opengl/util/BufferUtil.java" /> - <copy file="../src/jogl/classes/com/sun/opengl/impl/InternalBufferUtil.java.javame_cdc_fp" tofile="${src.generated.java-cdc}/com/sun/opengl/impl/InternalBufferUtil.java" /> - <copy file="../src/jogl/classes/com/sun/opengl/util/texture/TextureIO.java.javame_cdc_fp" tofile="${src.generated.java-cdc}/com/sun/opengl/util/texture/TextureIO.java" /> - <copy file="../src/jogl/classes/com/sun/opengl/util/texture/spi/DDSImage.java.javame_cdc_fp" tofile="${src.generated.java-cdc}/com/sun/opengl/util/texture/spi/DDSImage.java" /> - <copy file="../src/jogl/classes/com/sun/opengl/util/texture/spi/TGAImage.java.javame_cdc_fp" tofile="${src.generated.java-cdc}/com/sun/opengl/util/texture/spi/TGAImage.java" /> + <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/impl/InternalBufferUtil.java.javame_cdc_fp" tofile="${src.generated.java-cdc}/com/jogamp/opengl/impl/InternalBufferUtil.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/sun/opengl/impl/SystemUtil.java.javase" tofile="${src.generated.java}/com/sun/opengl/impl/SystemUtil.java" /> - <copy file="../src/jogl/classes/com/sun/opengl/util/BufferUtil.java.javase" tofile="${src.generated.java}/com/sun/opengl/util/BufferUtil.java" /> - <copy file="../src/jogl/classes/com/sun/opengl/impl/InternalBufferUtil.java.javase" tofile="${src.generated.java}/com/sun/opengl/impl/InternalBufferUtil.java" /> - <copy file="../src/jogl/classes/com/sun/opengl/util/texture/TextureIO.java.javase" tofile="${src.generated.java}/com/sun/opengl/util/texture/TextureIO.java" /> - <copy file="../src/jogl/classes/com/sun/opengl/util/texture/spi/DDSImage.java.javase" tofile="${src.generated.java}/com/sun/opengl/util/texture/spi/DDSImage.java" /> - <copy file="../src/jogl/classes/com/sun/opengl/util/texture/spi/TGAImage.java.javase" tofile="${src.generated.java}/com/sun/opengl/util/texture/spi/TGAImage.java" /> + <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/impl/InternalBufferUtil.java.javase" tofile="${src.generated.java}/com/jogamp/opengl/impl/InternalBufferUtil.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> <!-- ================================================================== --> @@ -489,10 +316,7 @@ - Initialize all parameters required for the build and create any - required directories. --> - <target name="init" depends="declare.common, declare.gl.gles, declare.gl.gl2, declare.common.2"> - <!-- Call the external config validator script to make sure the config is ok and consistent --> - <ant antfile="${validate.user.properties}" inheritall="true"/> - + <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}" /> @@ -503,33 +327,15 @@ <mkdir dir="${src.generated.c.openmax}" /> <mkdir dir="${classes}" /> <mkdir dir="${classes-cdc}" /> - <mkdir dir="${obj}" /> <mkdir dir="${obj.jogl}" /> - <mkdir dir="${obj.cg}" /> + <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> - <!-- ================================================================== --> - <!-- GlueGen and BuildStaticGLInfo creation, task setup and Java file generation --> - <!-- - - Build GlueGen - --> - <target name="build.gluegen" depends="init"> - <!-- 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.dir}" target="all" inheritAll="false"> - <propertyset> - <propertyref name="antlr.jar" /> - <!--propertyref name="gluegen.nsig" /--> - </propertyset> - </ant> - </target> - <!-- - Check to see whether we need to rebuild the generated sources. --> @@ -578,7 +384,7 @@ <and> <isset property="java.generate.skip.es1"/> <isset property="java.generate.skip.es2"/> - <!--isset property="java.generate.skip.gl2"/--> + <isset property="java.generate.skip.gl2"/> <isset property="java.generate.skip.glu"/> </and> </condition> @@ -594,7 +400,7 @@ <target name="java.generate.copy2temp"> <copy todir="${tempdir}"> - <fileset dir="${build}" + <fileset dir="${build.jogl}" includes="gensrc/classes/**" /> </copy> </target> @@ -603,9 +409,9 @@ <echo message="Generating GL interface" /> <antcall target="java.generate.copy2temp" inheritRefs="true" /> <gluegen src="${stub.includes.opengl}/gles2.c" - outputRootDir="${build}" - config="${config}/gl-if-gl.cfg" - includeRefid="stub.includes.fileset.all.gl2" + outputRootDir="${build.jogl}" + config="${config.jogl}/gl-if-gl.cfg" + includeRefid="stub.includes.fileset.all.gldesktop" emitter="com.sun.gluegen.opengl.GLEmitter"> <classpath refid="gluegen.classpath" /> </gluegen> @@ -615,9 +421,9 @@ <echo message="Generating GL2_ES1 interface" /> <antcall target="java.generate.copy2temp" inheritRefs="true" /> <gluegen src="${stub.includes.opengl}/gles1.c" - outputRootDir="${build}" - config="${config}/gl-if-gl2_es1.cfg" - includeRefid="stub.includes.fileset.all.gl2" + outputRootDir="${build.jogl}" + config="${config.jogl}/gl-if-gl2_es1.cfg" + includeRefid="stub.includes.fileset.all.gldesktop" emitter="com.sun.gluegen.opengl.GLEmitter"> <classpath refid="gluegen.classpath" /> </gluegen> @@ -627,9 +433,9 @@ <echo message="Generating GL2_ES2 interface" /> <antcall target="java.generate.copy2temp" inheritRefs="true" /> <gluegen src="${stub.includes.opengl}/gles2.c" - outputRootDir="${build}" - config="${config}/gl-if-gl2_es2.cfg" - includeRefid="stub.includes.fileset.all.gl2" + outputRootDir="${build.jogl}" + config="${config.jogl}/gl-if-gl2_es2.cfg" + includeRefid="stub.includes.fileset.all.gldesktop" emitter="com.sun.gluegen.opengl.GLEmitter"> <classpath refid="gluegen.classpath" /> </gluegen> @@ -639,16 +445,16 @@ <echo message="Generating GL2_GL3 interface" /> <antcall target="java.generate.copy2temp" inheritRefs="true" /> <gluegen src="${stub.includes.opengl}/gl3.c" - outputRootDir="${build}" - config="${config}/gl-gl3-set.cfg" - includeRefid="stub.includes.fileset.all.gl2" + outputRootDir="${build.jogl}" + config="${config.jogl}/gl-gl3-set.cfg" + includeRefid="stub.includes.fileset.all.gldesktop" emitter="com.sun.gluegen.opengl.GLEmitter"> <classpath refid="gluegen.classpath" /> </gluegen> <gluegen src="${stub.includes.opengl}/gl2.c" - outputRootDir="${build}" - config="${config}/gl-if-gl2_gl3.cfg" - includeRefid="stub.includes.fileset.all.gl2" + outputRootDir="${build.jogl}" + config="${config.jogl}/gl-if-gl2_gl3.cfg" + includeRefid="stub.includes.fileset.all.gldesktop" emitter="com.sun.gluegen.opengl.GLEmitter"> <classpath refid="gluegen.classpath" /> </gluegen> @@ -658,9 +464,9 @@ <echo message="Generating GL2 interface and implementation" /> <antcall target="java.generate.copy2temp" inheritRefs="true" /> <gluegen src="${stub.includes.opengl}/gl2.c" - outputRootDir="${build}" - config="${config}/gl-gl2.cfg" - includeRefid="stub.includes.fileset.all.gl2" + outputRootDir="${build.jogl}" + config="${config.jogl}/gl-gl2.cfg" + includeRefid="stub.includes.fileset.all.gldesktop" emitter="com.sun.gluegen.opengl.GLEmitter"> <classpath refid="gluegen.classpath" /> </gluegen> @@ -670,9 +476,9 @@ <echo message="Generating GL3 interface and implementation" /> <antcall target="java.generate.copy2temp" inheritRefs="true" /> <gluegen src="${stub.includes.opengl}/gl3.c" - outputRootDir="${build}" - config="${config}/gl-gl3.cfg" - includeRefid="stub.includes.fileset.all.gl2" + outputRootDir="${build.jogl}" + config="${config.jogl}/gl-gl3.cfg" + includeRefid="stub.includes.fileset.all.gldesktop" emitter="com.sun.gluegen.opengl.GLEmitter"> <classpath refid="gluegen.classpath" /> </gluegen> @@ -682,9 +488,33 @@ <echo message="Generating GL3bc implementation" /> <antcall target="java.generate.copy2temp" inheritRefs="true" /> <gluegen src="${stub.includes.opengl}/gl3bc.c" - outputRootDir="${build}" - config="${config}/gl-gl3bc.cfg" - includeRefid="stub.includes.fileset.all.gl2" + outputRootDir="${build.jogl}" + config="${config.jogl}/gl-gl3bc.cfg" + includeRefid="stub.includes.fileset.all.gldesktop" + emitter="com.sun.gluegen.opengl.GLEmitter"> + <classpath refid="gluegen.classpath" /> + </gluegen> + </target> + + <target name="java.generate.gl4"> + <echo message="Generating GL4 interface and implementation" /> + <antcall target="java.generate.copy2temp" inheritRefs="true" /> + <gluegen src="${stub.includes.opengl}/gl4.c" + outputRootDir="${build.jogl}" + config="${config.jogl}/gl-gl4.cfg" + includeRefid="stub.includes.fileset.all.gldesktop" + emitter="com.sun.gluegen.opengl.GLEmitter"> + <classpath refid="gluegen.classpath" /> + </gluegen> + </target> + + <target name="java.generate.gl4bc"> + <echo message="Generating GL4bc implementation" /> + <antcall target="java.generate.copy2temp" inheritRefs="true" /> + <gluegen src="${stub.includes.opengl}/gl4bc.c" + outputRootDir="${build.jogl}" + config="${config.jogl}/gl-gl4bc.cfg" + includeRefid="stub.includes.fileset.all.gldesktop" emitter="com.sun.gluegen.opengl.GLEmitter"> <classpath refid="gluegen.classpath" /> </gluegen> @@ -694,21 +524,21 @@ <echo message="Generating GL2ES12 implementation" /> <antcall target="java.generate.copy2temp" inheritRefs="true" /> <gluegen src="${stub.includes.opengl}/gl2es12.c" - outputRootDir="${build}" - config="${config}/gl-gl2es12.cfg" - includeRefid="stub.includes.fileset.all.gl2" + outputRootDir="${build.jogl}" + config="${config.jogl}/gl-gl2es12.cfg" + includeRefid="stub.includes.fileset.all.gldesktop" emitter="com.sun.gluegen.opengl.GLEmitter"> <classpath refid="gluegen.classpath" /> </gluegen> - </target> + </target> <target name="java.generate.gles1"> <echo message="Generating GLES1 interface and implementation" /> <antcall target="java.generate.copy2temp" inheritRefs="true" /> <gluegen src="${stub.includes.opengl}/gles1.c" - outputRootDir="${build}" - config="${config}/gl-es1.cfg" - includeRefid="stub.includes.fileset.all.gl2" + outputRootDir="${build.jogl}" + config="${config.jogl}/gl-es1.cfg" + includeRefid="stub.includes.fileset.all.gldesktop" emitter="com.sun.gluegen.opengl.GLEmitter"> <classpath refid="gluegen.classpath" /> </gluegen> @@ -718,21 +548,21 @@ <echo message="Generating GLES2 interface and implementation" /> <antcall target="java.generate.copy2temp" inheritRefs="true" /> <gluegen src="${stub.includes.opengl}/gles2.c" - outputRootDir="${build}" - config="${config}/gl-es2.cfg" - includeRefid="stub.includes.fileset.all.gl2" + outputRootDir="${build.jogl}" + config="${config.jogl}/gl-es2.cfg" + includeRefid="stub.includes.fileset.all.gldesktop" emitter="com.sun.gluegen.opengl.GLEmitter"> <classpath refid="gluegen.classpath" /> </gluegen> </target> - <target name="java.generate.gl.all" depends="java.generate.gl_if, java.generate.gl2_es1_if, java.generate.gl2_es2_if, java.generate.gl2_gl3_if, java.generate.gl2, java.generate.gl3, java.generate.gl3bc, java.generate.gl2es12, java.generate.gles1, java.generate.gles2"/> + <target name="java.generate.gl.all" depends="java.generate.gl_if, java.generate.gl2_es1_if, java.generate.gl2_es2_if, java.generate.gl2_gl3_if, java.generate.gl2, java.generate.gl3, java.generate.gl3bc, java.generate.gl4, java.generate.gl4bc, java.generate.gl2es12, java.generate.gles1, java.generate.gles2"/> <!-- target name="java.generate.gl.nsig" if="gluegen.nsig"> <echo message="Generating GL interface and implementation" /> <gluegen src="${gl.c}" config="${gl.cfg.nsig}" - includeRefid="stub.includes.fileset.all.gl2" + includeRefid="stub.includes.fileset.all.gldesktop" emitter="com.sun.gluegen.nativesig.NativeSignatureEmitter"> <classpath refid="gluegen.classpath" /> </gluegen> @@ -742,9 +572,9 @@ <echo message="Generating GLU class" /> <antcall target="java.generate.copy2temp" inheritRefs="true" /> <gluegen src="${stub.includes.opengl}/glu.c" - outputRootDir="${build}" - config="${config}/glu-base.cfg" - includeRefid="stub.includes.fileset.all.gl2" + outputRootDir="${build.jogl}" + config="${config.jogl}/glu-base.cfg" + includeRefid="stub.includes.fileset.all.gldesktop" emitter="com.sun.gluegen.opengl.GLEmitter"> <classpath refid="gluegen.classpath" /> </gluegen> @@ -754,9 +584,9 @@ <echo message="Generating GLU class" /> <antcall target="java.generate.copy2temp" inheritRefs="true" /> <gluegen src="${stub.includes.opengl}/glu.c" - outputRootDir="${build}" - config="${config}/glu-gl2es1.cfg" - includeRefid="stub.includes.fileset.all.gl2" + outputRootDir="${build.jogl}" + config="${config.jogl}/glu-gl2es1.cfg" + includeRefid="stub.includes.fileset.all.gldesktop" emitter="com.sun.gluegen.opengl.GLEmitter"> <classpath refid="gluegen.classpath" /> </gluegen> @@ -766,9 +596,9 @@ <echo message="Generating GLU class" /> <antcall target="java.generate.copy2temp" inheritRefs="true" /> <gluegen src="${stub.includes.opengl}/glu.c" - outputRootDir="${build}" - config="${config}/glu-gl2.cfg" - includeRefid="stub.includes.fileset.all.gl2" + outputRootDir="${build.jogl}" + config="${config.jogl}/glu-gl2.cfg" + includeRefid="stub.includes.fileset.all.gldesktop" emitter="com.sun.gluegen.opengl.GLEmitter"> <classpath refid="gluegen.classpath" /> </gluegen> @@ -778,9 +608,9 @@ <echo message="Generating platform-specific OpenGL extension class: ${window.os.system}" /> <antcall target="java.generate.copy2temp" inheritRefs="true" /> <gluegen src="${glext.platform.header}" - outputRootDir="${build}" + outputRootDir="${build.jogl}" config="${glext.platform.cfg}" - includeRefid="stub.includes.fileset.all.gl2" + includeRefid="stub.includes.fileset.all.gldesktop" emitter="com.sun.gluegen.opengl.GLEmitter"> <classpath refid="gluegen.classpath" /> </gluegen> @@ -789,9 +619,9 @@ <target name="java.generate.window.system.es" if="window.es.cfg"> <echo message="Generating EGL implementation class" /> <antcall target="java.generate.copy2temp" inheritRefs="true" /> - <dirset id="stub.includes.fileset.platform" dir="." includes="${stub.includes.dir}/${window.es.system}/** ${stub.includes.dir}/common/**" /> - <gluegen src="${stub.includes.dir}/${window.es.system}/window-system.c" - outputRootDir="${build}" + <dirset id="stub.includes.fileset.platform" dir="." includes="${stub.includes}/${window.es.system}/** ${stub.includes}/common/**" /> + <gluegen src="${stub.includes}/${window.es.system}/window-system.c" + outputRootDir="${build.jogl}" config="${window.es.cfg}" includeRefid="stub.includes.fileset.platform" emitter="com.sun.gluegen.opengl.GLEmitter"> @@ -802,9 +632,9 @@ <target name="java.generate.window.system.es.ext" if="window.es.ext.cfg"> <echo message="Generating EGLExt implementation class" /> <antcall target="java.generate.copy2temp" inheritRefs="true" /> - <dirset id="stub.includes.fileset.platform" dir="." includes="${stub.includes.dir}/${window.es.system}/** ${stub.includes.dir}/common/**" /> - <gluegen src="${stub.includes.dir}/${window.es.system}/window-system-ext.c" - outputRootDir="${build}" + <dirset id="stub.includes.fileset.platform" dir="." includes="${stub.includes}/${window.es.system}/** ${stub.includes}/common/**" /> + <gluegen src="${stub.includes}/${window.es.system}/window-system-ext.c" + outputRootDir="${build.jogl}" config="${window.es.ext.cfg}" includeRefid="stub.includes.fileset.platform" emitter="com.sun.gluegen.opengl.GLEmitter"> @@ -815,8 +645,8 @@ <target name="java.generate.window.system.os" if="window.os.cfg"> <echo message="Generating window system glue impl: ${window.os.system}" /> <antcall target="java.generate.copy2temp" inheritRefs="true" /> - <gluegen src="${stub.includes.dir}/${window.os.system}/window-system.c" - outputRootDir="${build}" + <gluegen src="${stub.includes}/${window.os.system}/window-system.c" + outputRootDir="${build.jogl}" config="${window.os.cfg}" includeRefid="stub.includes.fileset.platform" emitter="com.sun.gluegen.opengl.GLEmitter"> @@ -825,7 +655,7 @@ </target> <target name="java.generate.gl.platforms" > - <dirset id="stub.includes.fileset.platform" dir="." includes="${stub.includes.dir}/${window.os.system}/** ${stub.includes.dir}/${window.es.system}/** ${stub.includes.dir}/common/** ${stub.includes.dir}/opengl/**" /> + <dirset id="stub.includes.fileset.platform" dir="." includes="${stub.includes}/${window.os.system}/** ${stub.includes}/${window.es.system}/** ${stub.includes}/common/** ${stub.includes}/opengl/**" /> <antcall target="java.generate.window.system.os" inheritRefs="true" /> <antcall target="java.generate.platform.glext" inheritRefs="true" /> @@ -836,7 +666,7 @@ - from the C GL headers. This involves setting the taskdef and creating - the classpath reference id then running the task on each header. --> - <target name="java.generate" depends="build.gluegen, java.generate.check" unless="java.generate.skip"> + <target name="java.generate" depends="common.gluegen.build, java.generate.check" unless="java.generate.skip"> <!-- Add the GlueGen and BuildStaticGLInfo tasks to ANT --> <taskdef name="gluegen" classname="com.sun.gluegen.ant.GlueGenTask" @@ -856,23 +686,23 @@ <antcall target="java.generate.gl.platforms" inheritRefs="true"> <param name="window.os.system" value="x11"/> - <param name="window.os.cfg" value="${config}/glx-x11.cfg" /> - <param name="glext.platform.cfg" value="${config}/glxext.cfg" /> - <param name="glext.platform.header" value="${stub.includes.dir}/x11/glxext.c" /> + <param name="window.os.cfg" value="${config.jogl}/glx-x11.cfg" /> + <param name="glext.platform.cfg" value="${config.jogl}/glxext.cfg" /> + <param name="glext.platform.header" value="${stub.includes}/x11/glxext.c" /> </antcall> <antcall target="java.generate.gl.platforms" inheritRefs="true"> <param name="window.os.system" value="win32"/> - <param name="window.os.cfg" value="${config}/wgl-win32.cfg" /> - <param name="glext.platform.cfg" value="${config}/wglext.cfg" /> - <param name="glext.platform.header" value="${stub.includes.dir}/win32/wglext.c" /> + <param name="window.os.cfg" value="${config.jogl}/wgl-win32.cfg" /> + <param name="glext.platform.cfg" value="${config.jogl}/wglext.cfg" /> + <param name="glext.platform.header" value="${stub.includes}/win32/wglext.c" /> </antcall> <antcall target="java.generate.gl.platforms" inheritRefs="true"> <param name="window.os.system" value="macosx"/> - <param name="window.os.cfg" value="${config}/cgl-macosx.cfg" /> - <param name="glext.platform.cfg" value="${config}/cglext.cfg" /> - <param name="glext.platform.header" value="${stub.includes.dir}/macosx/cglext.c" /> + <param name="window.os.cfg" value="${config.jogl}/cgl-macosx.cfg" /> + <param name="glext.platform.cfg" value="${config.jogl}/cglext.cfg" /> + <param name="glext.platform.header" value="${stub.includes}/macosx/cglext.c" /> </antcall> <!-- Generate GLU class --> @@ -901,7 +731,7 @@ <!-- Now check for the presence of one well-known file --> <uptodate property="java.generate.cg.skip"> <srcfiles refid="stub.includes.cg.dependencies.fileset" /> - <mapper type="merge" to="${src.generated.java}/com/sun/opengl/cg/CgGL.java" /> + <mapper type="merge" to="${src.generated.java}/com/jogamp/opengl/cg/CgGL.java" /> </uptodate> </target> @@ -919,8 +749,8 @@ <!-- Generate CgGL interface class --> <gluegen src="${stub.includes.opengl}/cg.c" - outputRootDir="${build}" - config="${config}/cg-common.cfg" + outputRootDir="${build.jogl}" + config="${config.jogl}/cg-common.cfg" includeRefid="stub.includes.cg.fileset.all" emitter="com.sun.gluegen.JavaEmitter"> <classpath refid="gluegen.classpath" /> @@ -976,7 +806,7 @@ <uptodate property="java.generate.composable.pipeline.skip.gl2es12" srcfile="${classes}/javax/media/opengl/GL2ES12.class" targetfile="${src.generated.java}/javax/media/opengl/DebugGL2ES12.java" /> - </target> + </target> <target name="java.generate.composable.pipeline.check.gl2"> <!-- Blow away the DebugGL*.java and TraceGL*.java sources if GL*.class has changed @@ -986,7 +816,7 @@ <targetfileset dir="${src.generated.java}/javax/media/opengl" includes="DebugGL2.java,TraceGL2.java" /> </dependset> - + <!-- Now choose one of the two to test to see if we have to regenerate --> <uptodate property="java.generate.composable.pipeline.skip.gl2" srcfile="${classes}/javax/media/opengl/GL2.class" @@ -1008,6 +838,21 @@ targetfile="${src.generated.java}/javax/media/opengl/DebugGL3.java" /> </target> + <target name="java.generate.composable.pipeline.check.gl4"> + <!-- 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}/javax/media/opengl" files="GL4.class" /> + <targetfileset dir="${src.generated.java}/javax/media/opengl" + includes="DebugGL4.java,TraceGL4.java,DebugGL4bc.java,TraceGL4bc.java" /> + </dependset> + + <!-- Now choose one of the two to test to see if we have to regenerate --> + <uptodate property="java.generate.composable.pipeline.skip.gl4" + srcfile="${classes}/javax/media/opengl/GL4.class" + targetfile="${src.generated.java}/javax/media/opengl/DebugGL4.java" /> + </target> + <target name="java.generate.composable.pipeline.es1" depends="java.generate.composable.pipeline.check.es1" unless="java.generate.composable.pipeline.skip.es1"> <java classname="com.sun.gluegen.opengl.BuildComposablePipeline" fork="yes" failonerror="true"> <arg value="javax.media.opengl.GLES1" /> @@ -1081,41 +926,63 @@ </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"> + <target name="java.generate.composable.pipeline.gl4" depends="java.generate.composable.pipeline.check.gl4" unless="java.generate.composable.pipeline.skip.gl4"> + <java classname="com.sun.gluegen.opengl.BuildComposablePipeline" fork="yes" failonerror="true"> + <arg value="javax.media.opengl.GL4" /> + <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.sun.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"> </target> <target name="java.generate.composable.pipeline.custom.check.glfixfunc"> <!-- 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/sun/opengl/util/glsl/fixedfunc" files="FixedFuncHook.class" /> + <srcfilelist dir="${classes}/com/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/sun/opengl/util/glsl/fixedfunc/impl" + <targetfileset dir="${src.generated.java}/com/jogamp/opengl/util/glsl/fixedfunc/impl" 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/sun/opengl/util/glsl/fixedfunc/impl/FixedFuncImpl.java" /> + targetfile="${src.generated.java}/com/jogamp/opengl/util/glsl/fixedfunc/impl/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.sun.gluegen.opengl.BuildComposablePipeline" fork="yes" failonerror="true"> <arg value="javax.media.opengl.GL2ES1" /> - <arg value="${src.generated.java}/com/sun/opengl/util/glsl/fixedfunc/impl" /> - <arg value="com.sun.opengl.util.glsl.fixedfunc.impl.FixedFuncImpl" /> - <arg value="com.sun.opengl.util.glsl.fixedfunc.impl.FixedFuncHook" /> + <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="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/sun/opengl/util/glsl/fixedfunc/impl/FixedFuncImpl.java" /> + includes="com/jogamp/opengl/util/glsl/fixedfunc/impl/FixedFuncImpl.java" /> </copy> </target> - <target name="java.generate.composable.pipeline.custom" depends="init, build.gluegen, java.generate.composable.pipeline.custom.glfixfunc"> + <target name="java.generate.composable.pipeline.custom" depends="init, common.gluegen.build, java.generate.composable.pipeline.custom.glfixfunc"> </target> <!-- ================================================================== --> @@ -1128,9 +995,10 @@ <!-- Perform the first pass Java compile. --> <javac destdir="${classes}" - includes="javax/media/opengl/fixedfunc/** javax/media/opengl/GLDrawableFactory.java javax/media/opengl/GLDrawable.java javax/media/opengl/GLContext.java javax/media/opengl/GL.java javax/media/opengl/GL2ES1.java javax/media/opengl/GL2ES2.java javax/media/opengl/GL2GL3.java javax/media/opengl/GL2.java javax/media/opengl/GLES1.java javax/media/opengl/GLES2.java javax/media/opengl/GL3.java javax/media/opengl/GL3bc.java" + includes="javax/media/opengl/fixedfunc/** javax/media/opengl/GLDrawableFactory.java javax/media/opengl/GLDrawable.java javax/media/opengl/GLContext.java javax/media/opengl/GL.java javax/media/opengl/GL2ES1.java javax/media/opengl/GL2ES2.java javax/media/opengl/GL2GL3.java javax/media/opengl/GL2.java javax/media/opengl/GLES1.java javax/media/opengl/GLES2.java javax/media/opengl/GL3.java javax/media/opengl/GL3bc.java javax/media/opengl/GL4.java javax/media/opengl/GL4bc.java" fork="yes" memoryMaximumSize="${javac.memorymax}" + includeAntRuntime="false" source="1.4" debug="${javacdebug}" debuglevel="${javacdebuglevel}"> <classpath refid="nativewindow_gluegen.classpath"/> <src path="${src.java}" /> @@ -1140,7 +1008,7 @@ <copy todir="${src.generated.java-cdc}"> <fileset dir="${src.generated.java}" includes="**" - excludes="com/sun/opengl/cg/** com/sun/opengl/impl/gl2/** com/sun/opengl/impl/gl3/** com/sun/opengl/impl/glu/gl2/** javax/media/opengl/glu/gl2/**"/> + 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}" @@ -1151,10 +1019,11 @@ <target name="java.compile.secondpass.javase"> <!-- Perform the second pass Java compile; everything except portion of fixed function emulation depending on generated code. --> <javac destdir="${classes}" - excludes="com/sun/opengl/util/glsl/fixedfunc/FixedFuncUtil.java,${java.excludes.all}" - source="${jogl.sourcelevel}" + excludes="com/jogamp/opengl/util/glsl/fixedfunc/FixedFuncUtil.java,${java.excludes.all}" + source="${target.sourcelevel}" fork="yes" memoryMaximumSize="${javac.memorymax}" + includeAntRuntime="false" debug="${javacdebug}" debuglevel="${javacdebuglevel}"> <classpath refid="nativewindow_gluegen.classpath"/> <src path="${src.java}" /> @@ -1162,14 +1031,15 @@ </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/sun/opengl/util/glsl/fixedfunc/FixedFuncUtil.java,${java.excludes.all},${java.excludes.cdcfp}" - source="${jogl.sourcelevel}" - bootclasspath="${javac.bootclasspath-cdc.jar}" + 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}" /> @@ -1183,9 +1053,10 @@ <!-- Perform the third pass Java compile; everything including fixed function emulation. --> <javac destdir="${classes}" excludes="${java.excludes.all}" - source="${jogl.sourcelevel}" + source="${target.sourcelevel}" fork="yes" memoryMaximumSize="${javac.memorymax}" + includeAntRuntime="false" debug="${javacdebug}" debuglevel="${javacdebuglevel}"> <classpath refid="nativewindow_gluegen.classpath"/> <src path="${src.java}" /> @@ -1197,10 +1068,11 @@ <!-- Perform the third pass Java compile; everything including fixed function emulation. --> <javac destdir="${classes-cdc}" excludes="${java.excludes.all},${java.excludes.cdcfp}" - source="${jogl.sourcelevel}" + 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}" /> @@ -1426,7 +1298,7 @@ <condition property="c.compiler.use-debug"><istrue value="${c.compiler.debug}"/></condition> - <patternset id="c.src.files.jogl.gl2"> + <patternset id="c.src.files.jogl.desktop"> <include name="${rootrel.src.c}/macosx/MacOSXCustomCGLCode.c" if="isOSX"/> <include name="${rootrel.src.c}/macosx/MacOSXWindowSystemInterface.m" if="isOSX"/> <include name="${rootrel.src.c}/macosx/ContextUpdater.m" if="isOSX"/> @@ -1434,10 +1306,9 @@ <!-- FIXME: the Mixer should be moved to another library --> <!--include name="${rootrel.src.c}/Mixer.cpp" if="isWindows"/--> <include name="${rootrel.src.c.openmax}/omx_tool.c" if="useOpenMAX"/> - <include name="${rootrel.src.c.openmax}/com_sun_openmax_OMXInstance.c" if="useOpenMAX"/> + <include name="${rootrel.src.c.openmax}/com_jogamp_openmax_OMXInstance.c" if="useOpenMAX"/> - <include name="${rootrel.generated.c.jogl}/gl2/GL2Impl_JNI.c"/> - <include name="${rootrel.generated.c.jogl}/gl3/GL3Impl_JNI.c"/> + <include name="${rootrel.generated.c.jogl}/gl4/GL4bcImpl_JNI.c"/> <!--include name="${rootrel.generated.c.jogl}/GLU_JNI.c"/ EMPTY --> <include name="${rootrel.generated.c.jogl}/gl2/GLUgl2_JNI.c"/> <include name="${rootrel.generated.c.jogl}/X11/GLX*.c" if="isX11"/> @@ -1450,10 +1321,8 @@ <include name="${rootrel.src.c}/macosx/MacOSXWindowSystemInterface.m" if="isOSX"/> <include name="${rootrel.src.c}/macosx/ContextUpdater.m" if="isOSX"/> <include name="${rootrel.src.c}/GLXGetProcAddressARB.c" if="isX11"/> - <!-- FIXME: the Mixer should be moved to another library --> - <!--include name="${rootrel.src.c}/Mixer.cpp" if="isWindows"/--> <include name="${rootrel.src.c.openmax}/omx_tool.c" if="useOpenMAX"/> - <include name="${rootrel.src.c.openmax}/com_sun_openmax_OMXInstance.c" if="useOpenMAX"/> + <include name="${rootrel.src.c.openmax}/com_jogamp_openmax_OMXInstance.c" if="useOpenMAX"/> <include name="${rootrel.generated.c.jogl}/gl2es12/GL2ES12Impl_JNI.c"/> <!--include name="${rootrel.generated.c.jogl}/GLU_JNI.c"/ EMPTY --> @@ -1466,7 +1335,7 @@ <patternset id="c.src.files.jogl.es2"> <include name="${rootrel.src.c}/GLXGetProcAddressARB.c" if="isX11"/> <include name="${rootrel.src.c.openmax}/omx_tool.c" if="useOpenMAX"/> - <include name="${rootrel.src.c.openmax}/com_sun_openmax_OMXInstance.c" if="useOpenMAX"/> + <include name="${rootrel.src.c.openmax}/com_jogamp_openmax_OMXInstance.c" if="useOpenMAX"/> <include name="${rootrel.generated.c.jogl}/egl/EGL_JNI.c"/> <include name="${rootrel.generated.c.jogl}/egl/EGLExtImpl_JNI.c"/> @@ -1476,7 +1345,7 @@ <patternset id="c.src.files.jogl.es1"> <include name="${rootrel.src.c}/GLXGetProcAddressARB.c" if="isX11"/> <include name="${rootrel.src.c.openmax}/omx_tool.c" if="useOpenMAX"/> - <include name="${rootrel.src.c.openmax}/com_sun_openmax_OMXInstance.c" if="useOpenMAX"/> + <include name="${rootrel.src.c.openmax}/com_jogamp_openmax_OMXInstance.c" if="useOpenMAX"/> <include name="${rootrel.generated.c.jogl}/egl/EGL_JNI.c"/> <include name="${rootrel.generated.c.jogl}/egl/EGLExtImpl_JNI.c"/> @@ -1492,8 +1361,8 @@ <echo message="Compiling @{output.lib.name}" /> <cc outtype="shared" - objdir="${obj.jogl}" - outfile="${obj}/@{output.lib.name}" + objdir="${obj.joglsub}" + outfile="${obj.jogl}/@{output.lib.name}" optimize="${c.compiler.optimise}" debug="${c.compiler.debug}" multithreaded="true" @@ -1530,41 +1399,41 @@ </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"/> + <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}/obj/lib@{output.lib.name}.dylib" /> - <param name="dest" value="${build}/obj/lib@{output.lib.name}.jnilib" /> - <param name="dest-cdc" value="${build}/obj/lib@{output.lib.name}.so" /> + <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}/obj/lib@{output.lib.name}.so" /> - <param name="dest" value="${build}/obj/@{output.lib.name}.dll" /> + <param name="src" value="${build.jogl}/obj/lib@{output.lib.name}.so" /> + <param name="dest" value="${build.jogl}/obj/@{output.lib.name}.dll" /> </antcall> </sequential> </macrodef> <target name="c.build.jogl.prepare.openMAX" if="useOpenMAX"> - <javah destdir="${src.generated.c.openmax}" classpath="${classes-cdc}" class="com.sun.openmax.OMXInstance" /> + <javah destdir="${src.generated.c.openmax}" classpath="${classes-cdc}" class="com.jogamp.openmax.OMXInstance" /> </target> <target name="c.build.jogl.prepare" depends="c.build.jogl.prepare.openMAX"> <!-- Generate the waveout Mixer header --> <!-- FIXME: this is temporary until we move this to another workspace --> - <!--javah destdir="${build}/gensrc/native/jogl" classpath="${classes}" class="com.sun.javafx.audio.windows.waveout.Mixer" /--> + <!--javah destdir="${build.jogl}/gensrc/native/jogl" classpath="${classes}" class="com.jogamp.audio.windows.waveout.Mixer" /--> </target> - <target name="c.build.jogl.gl2" unless="setup.nodesktop"> - <c.build c.compiler.src.files="c.src.files.jogl.gl2" - output.lib.name="jogl_gl2" + <target name="c.build.jogl.desktop" unless="setup.nodesktop"> + <c.build c.compiler.src.files="c.src.files.jogl.desktop" + output.lib.name="jogl_desktop" compiler.cfg.id="${compiler.cfg.id}" linker.cfg.id="${linker.cfg.id.gl2}"/> </target> @@ -1598,28 +1467,32 @@ </target> <target name="c.manifest.cg" if="jogl.cg"> - <msvc.manifest objdir="${obj}" dllname="jogl_cg" /> + <msvc.manifest objdir="${obj.jogl}" dllname="jogl_cg" /> </target> <target name="c.manifest" if="isVC8Family"> <!-- exec mt, the Microsoft Manifest Tool, to include DLL manifests in order to resolve the location of msvcr80.dll --> - <msvc.manifest objdir="${obj}" dllname="jogl_es1" /> - <msvc.manifest objdir="${obj}" dllname="jogl_es2" /> - <msvc.manifest objdir="${obj}" dllname="jogl_gl2" /> - <msvc.manifest objdir="${obj}" dllname="jogl_gl2es12" /> + <msvc.manifest objdir="${obj.jogl}" dllname="jogl_es1" /> + <msvc.manifest objdir="${obj.jogl}" dllname="jogl_es2" /> + <msvc.manifest objdir="${obj.jogl}" dllname="jogl_gl2es12" /> + <msvc.manifest objdir="${obj.jogl}" dllname="jogl_desktop" /> <antcall target="c.manifest.cg" inheritRefs="true" /> </target> - <target name="c.build.jogl" depends="c.configure,c.build.jogl.prepare,c.build.jogl.gl2es12,c.build.jogl.gl2,c.build.jogl.es2,c.build.jogl.es1,c.build.jogl.cg"> + <target name="c.build.jogl" depends="c.configure,c.build.jogl.prepare,c.build.jogl.gl2es12,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" /> <!-- Create the Java Web Start jar file for the built native code --> - <jar destfile="${build}/jogl-natives-${os.and.arch}.jar" filesonly="true"> - <fileset dir="${obj}"> + <jar destfile="${build.jogl}/jogl-natives-${os.and.arch}.jar" filesonly="true"> + <fileset dir="${obj.jogl}"> <include name="*.${native.library.suffix}" /> </fileset> </jar> - <jar destfile="${build}/jogl-natives-${os.and.arch}-cdc.jar" filesonly="true"> - <fileset dir="${obj}"> + <jar 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}" /> <include name="*_gl2es12.${native.library.suffix-cdc}" /> @@ -1646,7 +1519,7 @@ <format property="timestamp" pattern="yyyyMMdd-HH:mm:ss"/> </tstamp> <copy file="${manifestfile}" - tofile="${build}/tempversion" + tofile="${build.jogl}/tempversion" overwrite="true"> <filterset> <!-- This token only exists in the non-RI version of the manifest --> @@ -1670,7 +1543,7 @@ <format property="timestamp" pattern="yyyyMMdd-HH:mm:ss"/> </tstamp> <copy file="${manifestfile}" - tofile="${build}/tempversion-cdc" + tofile="${build.jogl}/tempversion-cdc" overwrite="true"> <filterset> <!-- This token only exists in the non-RI version of the manifest --> @@ -1681,140 +1554,137 @@ </copy> </target> - <target name="build-cg-jar" depends="setup-manifestfile" if="jogl.cg"> - <jar manifest="${build}/tempversion" destfile="${jogl.cg.jar}" filesonly="true"> + <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}" includes="${java.part.nv-cg}"/> </jar> </target> - <target name="build-jars-es-desktop" depends="setup-manifestfile" unless="setup.nodesktop"> - <jar manifest="${build}/tempversion" destfile="${jogl.gl2es12.x11.jar}" filesonly="true"> - <fileset dir="${classes}" - includes="${java.part.glx}, ${java.part.gl2es12}, ${java.part.openmax}" - excludes="${java.part.glugl2}"/> + <target name="build-jars-os-desktop-javase" depends="setup-manifestfile" unless="setup.nodesktop"> + <jar manifest="${build.jogl}/tempversion" destfile="${jogl.os.x11.jar}" filesonly="true"> + <fileset dir="${classes}" includes="${java.part.glx}"/> </jar> - <jar manifest="${build}/tempversion" destfile="${jogl.gl2es12.win.jar}" filesonly="true"> - <fileset dir="${classes}" - includes="${java.part.wgl}, ${java.part.gl2es12}, ${java.part.openmax}" - excludes="${java.part.glugl2}"/> + <jar manifest="${build.jogl}/tempversion" destfile="${jogl.os.win.jar}" filesonly="true"> + <fileset dir="${classes}" includes="${java.part.wgl}" /> </jar> - <jar manifest="${build}/tempversion" destfile="${jogl.gl2es12.osx.jar}" filesonly="true"> - <fileset dir="${classes}" - includes="${java.part.cgl}, ${java.part.gl2es12}, ${java.part.openmax}" - excludes="${java.part.glugl2}"/> + <jar manifest="${build.jogl}/tempversion" destfile="${jogl.os.osx.jar}" filesonly="true"> + <fileset dir="${classes}" includes="${java.part.cgl}"/> </jar> </target> - <target name="build-jars-es" depends="setup-manifestfile,build-jars-es-desktop"> - <jar manifest="${build}/tempversion" destfile="${jogl.egl.jar}" filesonly="true"> + <target name="build-jars-es-javase" depends="setup-manifestfile"> + <jar manifest="${build.jogl}/tempversion" destfile="${jogl.egl.jar}" filesonly="true"> <fileset dir="${classes}" includes="${java.part.egl}" excludes="${java.part.awt}"/> </jar> - <jar manifest="${build}/tempversion" destfile="${jogl.gles1.jar}" filesonly="true"> + <jar manifest="${build.jogl}/tempversion" destfile="${jogl.gles1.jar}" filesonly="true"> <fileset dir="${classes}" includes="${java.part.es1}" excludes="${java.part.es1.dbg}"/> </jar> - <jar manifest="${build}/tempversion" destfile="${jogl.gles1.dbg.jar}" filesonly="true"> + <jar manifest="${build.jogl}/tempversion" destfile="${jogl.gles1.dbg.jar}" filesonly="true"> <fileset dir="${classes}" includes="${java.part.es1.dbg}"/> </jar> - <jar manifest="${build}/tempversion" destfile="${jogl.gles2.jar}" filesonly="true"> + <jar manifest="${build.jogl}/tempversion" destfile="${jogl.gles2.jar}" filesonly="true"> <fileset dir="${classes}" includes="${java.part.es2}, ${java.part.openmax}" excludes="${java.part.es2.dbg}"/> </jar> - <jar manifest="${build}/tempversion" destfile="${jogl.gles2.dbg.jar}" filesonly="true"> + <jar manifest="${build.jogl}/tempversion" destfile="${jogl.gles2.dbg.jar}" filesonly="true"> <fileset dir="${classes}" includes="${java.part.es2.dbg}"/> </jar> </target> - <target name="build-jars-es-desktop-cdc" depends="setup-manifestfile-cdc" unless="setup.nodesktop"> - <jar manifest="${build}/tempversion-cdc" destfile="${jogl.gl2es12.x11.cdc.jar}" filesonly="true"> - <fileset dir="${classes-cdc}" - includes="${java.part.glx}, ${java.part.gl2es12}, ${java.part.openmax}" - excludes="${java.part.glugl2}"/> + <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}/tempversion-cdc" destfile="${jogl.gl2es12.win.cdc.jar}" filesonly="true"> - <fileset dir="${classes-cdc}" - includes="${java.part.wgl}, ${java.part.gl2es12}, ${java.part.openmax}" - excludes="${java.part.glugl2}"/> + <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}/tempversion-cdc" destfile="${jogl.gl2es12.osx.cdc.jar}" filesonly="true"> + <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-desktop-cdc" depends="setup-manifestfile-cdc,build-jars-os-desktop-cdc" unless="setup.nodesktop"> + <jar manifest="${build.jogl}/tempversion-cdc" destfile="${jogl.gl2es12.cdc.jar}" filesonly="true"> <fileset dir="${classes-cdc}" - includes="${java.part.cgl}, ${java.part.gl2es12}, ${java.part.openmax}" - excludes="${java.part.glugl2}"/> + includes="${java.part.gl2es12}, ${java.part.openmax}" + excludes="${java.part.glugldesktop}"/> </jar> </target> - <target name="build-jars-es-cdc" depends="setup-manifestfile-cdc,build-jars-es-desktop-cdc" unless="setup.noCDC"> - <jar manifest="${build}/tempversion-cdc" destfile="${jogl.egl.cdc.jar}" filesonly="true"> + <target name="build-jars-es-cdc" depends="setup-manifestfile-cdc, build-jars-es-desktop-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}/tempversion-cdc" destfile="${jogl.gles1.cdc.jar}" filesonly="true"> + <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}/tempversion-cdc" destfile="${jogl.gles1.dbg.cdc.jar}" filesonly="true"> + <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}/tempversion-cdc" destfile="${jogl.gles2.cdc.jar}" filesonly="true"> + <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}/tempversion-cdc" destfile="${jogl.gles2.dbg.cdc.jar}" filesonly="true"> + <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" depends="setup-manifestfile" unless="setup.noAWT"> - <jar manifest="${build}/tempversion" destfile="${jogl.awt.jar}" filesonly="true"> + <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}" includes="${java.part.awt}" /> </jar> - <jar manifest="${build}/tempversion" destfile="${jogl.util.awt.jar}" filesonly="true"> + <jar manifest="${build.jogl}/tempversion" destfile="${jogl.util.awt.jar}" filesonly="true"> <fileset dir="${classes}" includes="${java.part.util.awt}"/> </jar> </target> - <target name="build-jars-all-awt" depends="setup-manifestfile" unless="setup.noall"> - <jar manifest="${build}/tempversion" destfile="${jogl.all.jar}" filesonly="true"> + <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}"> <include name="javax/media/opengl/**" /> - <include name="com/sun/gluegen/runtime/**" /> - <include name="com/sun/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/sun/javafx/**" /> + <include name="com/jogamp/**" /> + <exclude name="${java.part.gl2es12}"/> </fileset> <fileset dir="${src.java}" includes="${java.part.util.fixedfuncemu.shadercode}"/> </jar> </target> - <target name="build-jars-all-noawt" depends="setup-manifestfile"> - <jar manifest="${build}/tempversion" destfile="${jogl.all-noawt.jar}" filesonly="true"> + <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/sun/gluegen/runtime/** com/sun/opengl/** ${java.part.openmax} com/sun/javafx/**" - excludes="${java.part.awt} ${java.part.util.awt}"> + includes="javax/media/opengl/** com/jogamp/gluegen/runtime/** com/jogamp/opengl/** ${java.part.openmax} com/jogamp/**" + excludes="${java.part.awt} ${java.part.util.awt} ${java.part.gl2es12}"> </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}/tempversion-cdc" destfile="${jogl.all.cdc.jar}" filesonly="true"> + <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.gl2es12} ${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}" + 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.gl2es12} ${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}"/> @@ -1823,25 +1693,25 @@ <target name="build-jars-cdc" depends="setup-manifestfile-cdc, build-jars-es-cdc, build-jars-all-cdc" unless="setup.noCDC"> - <jar manifest="${build}/tempversion-cdc" destfile="${jogl.core.cdc.jar}" filesonly="true"> + <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}/tempversion-cdc" destfile="${jogl.glutess.cdc.jar}" filesonly="true"> + <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}/tempversion-cdc" destfile="${jogl.glumipmap.cdc.jar}" filesonly="true"> + <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}/tempversion-cdc" destfile="${jogl.util.cdc.jar}" filesonly="true"> + <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.gl2} ${java.part.util.fixedfuncemu}"/> + excludes="${java.part.util.awt} ${java.part.util.gldesktop} ${java.part.util.fixedfuncemu}"/> </jar> - <jar manifest="${build}/tempversion-cdc" destfile="${jogl.util.fixedfuncemu.cdc.jar}" filesonly="true"> + <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}" @@ -1849,61 +1719,58 @@ </jar> </target> - <target name="build-jars-desktop-javase" depends="setup-manifestfile" unless="setup.nodesktop"> - <jar manifest="${build}/tempversion" destfile="${jogl.gl2.x11.jar}" filesonly="true"> + <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.glx}, ${java.part.gl2}, ${java.part.gl3}, ${java.part.openmax}" - excludes="${java.part.gl2.dbg}, ${java.part.gl3.dbg}, ${java.part.glugl2}"/> + includes="${java.part.gldesktop}, ${java.part.openmax}" + excludes="${java.part.gldesktop.dbg}, ${java.part.glugldesktop}, ${java.part.gl2es12}"/> </jar> - <jar manifest="${build}/tempversion" destfile="${jogl.gl2.win.jar}" filesonly="true"> - <fileset dir="${classes}" - includes="${java.part.wgl}, ${java.part.gl2}, $${java.part.gl3}, {java.part.openmax}" - excludes="${java.part.gl2.dbg}, ${java.part.gl3.dbg}, ${java.part.glugl2}"/> + <jar manifest="${build.jogl}/tempversion" destfile="${jogl.gl2es12.jar}" filesonly="true"> + <fileset dir="${classes}" includes="${java.part.gl2es12}, ${java.part.openmax}" + excludes="${java.part.glugldesktop}"/> </jar> - <jar manifest="${build}/tempversion" destfile="${jogl.gl2.osx.jar}" filesonly="true"> - <fileset dir="${classes}" - includes="${java.part.cgl}, ${java.part.gl2}, $${java.part.gl3}, {java.part.openmax}" - excludes="${java.part.gl2.dbg}, ${java.part.gl3.dbg}, ${java.part.glugl2}"/> - </jar> - <jar manifest="${build}/tempversion" destfile="${jogl.gl2.dbg.jar}" filesonly="true"> + + <!-- misc --> + <jar manifest="${build.jogl}/tempversion" destfile="${jogl.gldesktop.dbg.jar}" filesonly="true"> <fileset dir="${classes}" - includes="${java.part.gl2.dbg} ${java.part.gl3.dbg}"/> + includes="${java.part.gldesktop.dbg}"/> </jar> - <jar manifest="${build}/tempversion" destfile="${jogl.glugl2.jar}" filesonly="true"> + <jar manifest="${build.jogl}/tempversion" destfile="${jogl.glugldesktop.jar}" filesonly="true"> <fileset dir="${classes}" - includes="${java.part.glugl2}"/> + includes="${java.part.glugldesktop}"/> </jar> - <jar manifest="${build}/tempversion" destfile="${jogl.util.gl2.jar}" filesonly="true"> + <jar manifest="${build.jogl}/tempversion" destfile="${jogl.util.gldesktop.jar}" filesonly="true"> <fileset dir="${classes}" - includes="${java.part.util.gl2}" - excludes="com/sun/opengl/**/awt/**"/> + includes="${java.part.util.gldesktop}" + excludes="com/jogamp/opengl/**/awt/**"/> </jar> </target> - <target name="build-jars-javase" depends="setup-manifestfile, build-jars-es, build-jars-awt, build-cg-jar, build-jars-all-awt, build-jars-all-noawt, build-jars-desktop-javase"> - <jar manifest="${build}/tempversion" destfile="${jogl.core.jar}" filesonly="true"> + <target name="build-jars-javase" depends="setup-manifestfile, build-jars-es-javase, build-jars-awt-javase, build-cg-jar-javase, build-jars-all-awt-javase, build-jars-all-noawt-javase, build-jars-desktop-javase"> + <jar manifest="${build.jogl}/tempversion" destfile="${jogl.core.jar}" filesonly="true"> <fileset dir="${classes}" includes="${java.part.core}" excludes="${java.part.core.exclude}"/> </jar> - <jar manifest="${build}/tempversion" destfile="${jogl.sdk.jar}" filesonly="true"> + <jar manifest="${build.jogl}/tempversion" destfile="${jogl.sdk.jar}" filesonly="true"> <fileset dir="${classes}" includes="${java.part.sdk}"/> </jar> - <jar manifest="${build}/tempversion" destfile="${jogl.glutess.jar}" filesonly="true"> + <jar manifest="${build.jogl}/tempversion" destfile="${jogl.glutess.jar}" filesonly="true"> <fileset dir="${classes}" includes="${java.part.glutess}"/> </jar> - <jar manifest="${build}/tempversion" destfile="${jogl.glumipmap.jar}" filesonly="true"> + <jar manifest="${build.jogl}/tempversion" destfile="${jogl.glumipmap.jar}" filesonly="true"> <fileset dir="${classes}" includes="${java.part.glumipmap}"/> </jar> - <jar manifest="${build}/tempversion" destfile="${jogl.util.jar}" filesonly="true"> + <jar manifest="${build.jogl}/tempversion" destfile="${jogl.util.jar}" filesonly="true"> <fileset dir="${classes}" includes="${java.part.util} ${java.part.util.glsl}" - excludes="${java.part.util.awt} ${java.part.util.gl2} ${java.part.util.fixedfuncemu}"/> + excludes="${java.part.util.awt} ${java.part.util.gldesktop} ${java.part.util.fixedfuncemu}"/> </jar> - <jar manifest="${build}/tempversion" destfile="${jogl.util.fixedfuncemu.jar}" filesonly="true"> + <jar manifest="${build.jogl}/tempversion" destfile="${jogl.util.fixedfuncemu.jar}" filesonly="true"> <fileset dir="${classes}" includes="${java.part.util.fixedfuncemu}"/> <fileset dir="${src.java}" @@ -1918,7 +1785,7 @@ - on the platform specific build targets. To circumvent any - errors, ensure that the source is built first. --> - <target name="javadoc.nocg" depends="load.user.properties,init" unless="jogl.cg"> + <target name="javadoc.nocg" depends="init" unless="jogl.cg"> <!-- Build the general public Javadoc --> <javadoc packagenames="${javadoc.packagenames}" excludepackagenames="${java.excludes.javadoc.packagenames}" @@ -1935,9 +1802,9 @@ </target> <!-- Same as above but with Cg directories added --> - <target name="javadoc.cg" depends="load.user.properties,init" if="jogl.cg"> + <target name="javadoc.cg" depends="init" if="jogl.cg"> <!-- Build the general public Javadoc with CG --> - <javadoc packagenames="${javadoc.packagenames},com.sun.opengl.cg" + <javadoc packagenames="${javadoc.packagenames},com.jogamp.opengl.cg" excludepackagenames="${java.excludes.javadoc.packagenames}" sourcepath="${src.java};${src.generated.java}" destdir="${javadoc}" windowtitle="${javadoc.windowtitle}" @@ -1953,7 +1820,7 @@ <target name="javadoc" depends="javadoc.nocg,javadoc.cg" /> - <target name="javadoc.spec.nocg" depends="load.user.properties,init" unless="jogl.cg"> + <target name="javadoc.spec.nocg" depends="init" unless="jogl.cg"> <!-- Build the specification Javadoc --> <javadoc packagenames="${javadoc.spec.packagenames}" excludepackagenames="${java.excludes.javadoc.packagenames}" @@ -1970,7 +1837,7 @@ </target> <!-- Same as above since Cg directories are not part of spec --> - <target name="javadoc.spec.cg" depends="load.user.properties,init" if="jogl.cg"> + <target name="javadoc.spec.cg" depends="init" if="jogl.cg"> <!-- Build the specification Javadoc with CG --> <javadoc packagenames="${javadoc.spec.packagenames}" excludepackagenames="${java.excludes.javadoc.packagenames}" @@ -2007,7 +1874,7 @@ <!-- Same as above but with Cg directories added --> <target name="javadoc.dev.cg" if="jogl.cg"> <!-- Build the internal developer Javadoc --> - <javadoc packagenames="${javadoc.dev.packagenames},com.sun.opengl.cg" + <javadoc packagenames="${javadoc.dev.packagenames},com.jogamp.opengl.cg" excludepackagenames="${java.excludes.javadoc.packagenames}" sourcepath="${src.java};${src.generated.java}" destdir="${javadoc.dev}" windowtitle="${javadoc.windowtitle}" @@ -2021,7 +1888,7 @@ </javadoc> </target> - <target name="javadoc.dev.all" depends="load.user.properties,init,javadoc.dev.nocg,javadoc.dev.cg" /> + <target name="javadoc.dev.all" depends="init,javadoc.dev.nocg,javadoc.dev.cg" /> <target name="all.doc" description="Build JOGL docs" depends="init,javadoc,javadoc.spec,javadoc.dev.all" /> @@ -2032,7 +1899,7 @@ <target name="clean" description="Remove all build products" depends="declare.common"> <delete includeEmptyDirs="true" quiet="true"> <fileset dir="${tempdir}" /> - <fileset dir="${build}" /> + <fileset dir="${build.jogl}" /> <fileset dir="${javadoc}" /> <fileset dir="${javadoc.spec}" /> <fileset dir="${javadoc.dev}" /> @@ -2043,22 +1910,11 @@ <!-- - Build everything. --> - <target name="all" description="Build JOGL JAR file(s) and native libraries." depends="load.user.properties,init,jar,c.build.jogl,generate.version.txt" /> - - <target name="setup-version-RI" if="jogl.ri"> - <property name="tmp.version" value="${jogl_base_version}" /> - </target> - - <target name="setup-version-non-RI" unless="jogl.ri"> - <tstamp> - <format property="version.timestamp" pattern="yyyyMMdd"/> - </tstamp> - <property name="tmp.version" value="${jogl_base_version}-pre-${version.timestamp}" /> - </target> + <target name="all" description="Build JOGL JAR file(s) and native libraries." depends="init,jar,c.build.jogl,generate.version.txt" /> - <target name="generate.version.txt" depends="setup-version-RI,setup-version-non-RI"> + <target name="generate.version.txt" depends="init"> <!-- Create a version.txt file indicating which version we just built --> - <echo message="${tmp.version}" file="${build}/version.txt" /> + <echo message="${jogl.version}" file="${build.jogl}/version.txt" /> </target> <!-- ================================================================== --> diff --git a/make/build-junit.xml b/make/build-junit.xml new file mode 100644 index 000000000..ebf3f683e --- /dev/null +++ b/make/build-junit.xml @@ -0,0 +1,195 @@ +<?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="10000"/> + + </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" depends="init"> + <!-- 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> + <jar destfile="${jogl.test.jar}" filesonly="true"> + <fileset dir="${classes}"> + <include name="${java.part.test}"/> + </fileset> + </jar> + </target> + + <target name="junit.run" depends="junit.compile"> + <!-- Perform the junit tests--> + <mkdir dir="${results.junit}" /> + <delete quiet="true"> + <fileset dir="${results.junit}" includes="**"/> + </delete> + + <condition property="jvmarg.newt" value="-XstartOnFirstThread -Djava.awt.headless=true"><isset property="isOSX"/></condition> + <condition property="jvmarg.newt" value="-Djava.awt.headless=true"><not><isset property="isOSX"/></not></condition> + + <!-- Test*CORE* --> + <junit forkmode="once" 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}"/> + + <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*CORE*"/> + </fileset> + <formatter usefile="false" type="brief"/> + <formatter usefile="true" type="xml"/> + </batchtest> + </junit> + + <!-- 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*"/> + </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}"/> + <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> + + <!-- Test*AWT* --> + <junit forkmode="once" 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="-Dgluegen.debug.NativeLibrary=true"/> + <jvmarg value="-Dgluegen.debug.ProcAddressHelper=true"/> + <jvmarg value="-Djogl.debug.GLSLState"/> + <jvmarg value="-Dnativewindow.debug=all"/> + <jvmarg value="-Djogl.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*AWT*"/> + </fileset> + <formatter usefile="false" type="brief"/> + <formatter usefile="true" type="xml"/> + </batchtest> + </junit> + + </target> + + <!-- ================================================================== --> + <!-- + - 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 2e3c431ec..8d1639502 100644 --- a/make/build-nativewindow.xml +++ b/make/build-nativewindow.xml @@ -53,25 +53,13 @@ --> <project name="NativeWindow" basedir="." default="all"> - <import file="versions.xml" /> - - <!-- Pull in GlueGen cpptasks build file --> - <property name="gluegen.root" value="../../gluegen" /> - <import file="${gluegen.root}/make/gluegen-cpptasks.xml" /> + <import file="build-common.xml"/> <!-- ================================================================== --> <!-- - Base initialization and detection of operating system. --> - <target name="base.init" depends="gluegen.cpptasks.detect.os"> - - <condition property="setup.nodesktop"> - <and> - <isfalse value="${isWindows}" /> - <isfalse value="${isOSX}" /> - <isfalse value="${isX11}" /> - </and> - </condition> + <target name="base.init" depends="common.init"> <condition property="setup.noNativeAWT"> <or> @@ -80,28 +68,18 @@ </or> </condition> - <condition property="setup.noall"> - <isset property="setup.noAWT"/> - </condition> - - <property name="javac.bootclasspath-cdc.jar" value="../../gluegen/make/lib/cdc_fp.jar" /> - - <echo message="setup.nodesktop: ${setup.nodesktop}" /> - <echo message="setup.noall: ${setup.noall}" /> - <echo message="setup.noAWT: ${setup.noAWT}" /> <echo message="setup.noNativeAWT: ${setup.noNativeAWT}" /> - <echo message="javac.bootclasspath-cdc.jar: ${javac.bootclasspath-cdc.jar}" /> <!-- partitioning --> <property name="java.part.core" - value="javax/media/nativewindow/*, javax/media/nativewindow/egl/*, javax/media/nativewindow/macosx/*, javax/media/nativewindow/windows/*, com/sun/nativewindow/impl/*, com/sun/nativewindow/impl/jvm/*"/> + value="javax/media/nativewindow/*, javax/media/nativewindow/egl/*, javax/media/nativewindow/macosx/*, javax/media/nativewindow/windows/*, com/jogamp/nativewindow/impl/*, com/jogamp/nativewindow/impl/jvm/*"/> <property name="java.part.awt" - value="javax/media/nativewindow/awt/*, com/sun/nativewindow/impl/jawt/**, com/sun/nativewindow/impl/**/awt/**"/> + value="javax/media/nativewindow/awt/*, com/jogamp/nativewindow/impl/jawt/**, com/jogamp/nativewindow/impl/**/awt/**"/> <property name="java.part.x11" - value="com/sun/nativewindow/impl/x11/** javax/media/nativewindow/x11/*" /> + value="com/jogamp/nativewindow/impl/x11/** javax/media/nativewindow/x11/*" /> <!-- condition excludes --> @@ -112,109 +90,47 @@ <property name="java.excludes.all" value="${java.excludes.awt}" /> <echo message="java.excludes.all: ${java.excludes.all}" /> - - - <!-- Set the project root directory to be up one directory. --> - <property name="project.root" value=".." /> - - <!-- Set the configuration and build files to this directory. --> - <property name="make" value="." /> - </target> - - <target name="base.init.sourcelevel.1"> - <property name="nativewindow.sourcelevel" value="1.4" /> </target> - <!--target name="base.init.sourcelevel.2" if="gluegen.nsig"> - <property name="nativewindow.sourcelevel" value="1.5" /> - </target--> - - <!-- ================================================================== --> - <!-- - - Load user properties which override build defaults. - --> - <target name="load.user.properties" depends="base.init,base.init.sourcelevel.1" unless="user.properties.file"> - <!-- Load the user specified properties file that defines various host - - specific paths. The user will be notified if this is does not - - exist. --> - <property name="user.properties.file" value="${user.home}/nativewindow.properties" /> - <property file="${user.properties.file}" /> - <echo message="Loaded ${user.properties.file}." /> - <property file="${user.home}/gluegen.properties" /> - <echo message="Loaded ${user.home}/gluegen.properties." /> - <fail message="antlr.jar was not specified in nativewindow.properties or gluegen.properties. Please see README.txt for instructions" unless="antlr.jar"/> - <echo message="antlr.jar=${antlr.jar}" /> - </target> <!-- ================================================================== --> <!-- - Declare all paths and user defined variables. --> - <target name="declare.common" description="Declare properties" depends="load.user.properties"> - <!-- The location and name of the configuration ANT file that will - - validate to ensure that all user-define variables are set. --> - <property name="validate.user.properties" value="${make}/validate-properties.xml" /> - - <!-- 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" /> - - <!-- Names of directories relative to the project root. - Some of these are used in FileMappers later for dependence information - and need exact string matching, which is why they use file.separator - instead of "/". --> - <condition property="rootrel.build" value="build"> - <not> - <isset property="rootrel.build"/> - </not> - </condition> - <property name="rootrel.build.nativewindow" value="${rootrel.build}/nativewindow" /> + <target name="declare.common" description="Declare properties" depends="base.init"> + + <property name="config.nativewindow" value="${config}/nativewindow" /> + <property name="rootrel.src" value="src/nativewindow" /> <property name="rootrel.src.java" value="${rootrel.src}/classes" /> <property name="rootrel.src.c" value="${rootrel.src}/native" /> - <property name="rootrel.src.generated" value="${rootrel.build.nativewindow}/gensrc" /> + <property name="rootrel.src.generated" value="${rootrel.build}/nativewindow/gensrc" /> <property name="rootrel.generated.c" value="${rootrel.src.generated}/native" /> - <property name="rootrel.obj" value="${rootrel.build.nativewindow}/obj" /> - - <!-- GlueGen properties. --> - <!-- NOTE that these require a checked-out GlueGen workspace as a --> - <!-- sibling of the NativeWindow workspace. --> - <property name="gluegen.make.dir" value="../../gluegen/make" /> - <property name="gluegen.build.xml" value="${gluegen.make.dir}/build.xml" /> - <property name="gluegen.jar" value="../../gluegen/${rootrel.build}/gluegen.jar" /> - <property name="gluegen-rt.jar" value="../../gluegen/${rootrel.build}/gluegen-rt.jar" /> - <property name="gluegen-rt-cdc.jar" value="../../gluegen/${rootrel.build}/gluegen-rt-cdc.jar" /> - + <!-- The source directories. --> <property name="src.java" value="${project.root}/${rootrel.src.java}" /> <property name="src.c" value="${project.root}/${rootrel.src.c}" /> - <property name="build" value="${project.root}/${rootrel.build.nativewindow}" /> <!-- The generated source directories. --> - <property name="src.generated" value="${build}/gensrc" /> + <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}/classes" /> - <property name="classes-cdc" value="${build}/classes-cdc" /> - <property name="obj" value="${project.root}/${rootrel.obj}" /> + <property name="classes" value="${build.nativewindow}/classes" /> + <property name="classes-cdc" value="${build.nativewindow}/classes-cdc" /> <!-- The headers from which Java files are generated --> - <property name="config" value="${make}/config/nativewindow" /> - <property name="stub.includes" value="${make}/stub_includes" /> - <property name="stub.includes.dir" value="stub_includes" /> <!-- NOTE: this MUST be relative for FileSet --> - <property name="stub.includes.common" value="${stub.includes}/common" /> <dirset id="stub.includes.fileset.all" dir="."> - <include name="${stub.includes.dir}/macosx/**" /> - <include name="${stub.includes.dir}/win32/**" /> - <include name="${stub.includes.dir}/x11/**" /> - <include name="${stub.includes.dir}/common/**" /> - <include name="${stub.includes.dir}/jni/**" /> + <include name="${stub.includes}/macosx/**" /> + <include name="${stub.includes}/win32/**" /> + <include name="${stub.includes}/x11/**" /> + <include name="${stub.includes}/common/**" /> + <include name="${stub.includes}/jni/**" /> </dirset> - <fileset id="stub.includes.dependencies.fileset.1" dir="${stub.includes.dir}"> + <fileset id="stub.includes.dependencies.fileset.1" dir="${stub.includes}"> <include name="macosx/**" /> <include name="win32/**" /> <include name="x11/**" /> @@ -222,30 +138,12 @@ <include name="jni/**" /> </fileset> <fileset id="stub.includes.dependencies.fileset.2" file="${gluegen.jar}" /> - <fileset id="stub.includes.dependencies.fileset.3" dir="${config}"> + <fileset id="stub.includes.dependencies.fileset.3" dir="${config.nativewindow}"> <include name="*.cfg" /> <include name="*.java" /> <include name="*.c" /> </fileset> - <!-- Create the classpath that includes GlueGen and - - ANTLR. This requires the user-defined "antlr.jar" - - property. --> - <path id="gluegen.classpath"> - <pathelement location="${gluegen.jar}" /> - <pathelement location="${antlr.jar}" /> - </path> - - <!-- The resulting nativewindow.jar. --> - <property name="nativewindow.core.jar" value="${build}/nativewindow.core.jar" /> - <property name="nativewindow.awt.jar" value="${build}/nativewindow.awt.jar" /> - <property name="nativewindow.x11.jar" value="${build}/nativewindow.x11.jar" /> - <property name="nativewindow.all.jar" value="${build}/nativewindow.all.jar" /> - - <property name="nativewindow.core.cdc.jar" value="${build}/nativewindow.core.cdc.jar" /> - <property name="nativewindow.x11.cdc.jar" value="${build}/nativewindow.x11.cdc.jar" /> - <property name="nativewindow.all.cdc.jar" value="${build}/nativewindow.all.cdc.jar" /> - <!-- The javadoc dirs. --> <property name="javadoc" value="${project.root}/javadoc_nativewindow_public" /> <property name="javadoc.spec" value="${project.root}/javadoc_nativewindow_spec" /> @@ -257,7 +155,7 @@ <property name="javadoc.packagenames" value="${javadoc.spec.packagenames}" /> - <property name="javadoc.dev.packagenames" value="${javadoc.packagenames},com.sun.nativewindow.impl.*,com.sun.gluegen,com.sun.gluegen.runtime" /> + <property name="javadoc.dev.packagenames" value="${javadoc.packagenames},com.jogamp.nativewindow.impl.*,com.sun.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> @@ -267,9 +165,6 @@ - required directories. --> <target name="init" depends="declare.common"> - <!-- Call the external config validator script to make sure the config is ok and consistent --> - <ant antfile="${validate.user.properties}" inheritall="true"/> - <!-- Create the required output directories. --> <mkdir dir="${src.generated.java}" /> <mkdir dir="${src.generated.java-cdc}" /> @@ -279,25 +174,7 @@ <mkdir dir="${src.generated.c}/X11" /> <mkdir dir="${classes}" /> <mkdir dir="${classes-cdc}" /> - <mkdir dir="${obj}" /> - </target> - - <!-- ================================================================== --> - <!-- GlueGen and BuildStaticGLInfo creation, task setup and Java file generation --> - <!-- - - Build GlueGen - --> - <target name="build.gluegen" depends="init"> - <!-- 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.dir}" target="all" inheritAll="false"> - <propertyset> - <propertyref name="antlr.jar" /> - <!--propertyref name="gluegen.nsig" /--> - </propertyset> - </ant> + <mkdir dir="${obj.nativewindow}" /> </target> <!-- @@ -320,13 +197,13 @@ <!-- Now check for the presence of one well-known file --> <uptodate property="java.generate.skip.x11windowlib" - targetfile="${src.generated.java}/com/sun/nativewindow/impl/x11/X11Lib.java"> + targetfile="${src.generated.java}/com/jogamp/nativewindow/impl/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/sun/nativewindow/impl/jawt/JAWT.java"> + targetfile="${src.generated.java}/com/jogamp/nativewindow/impl/jawt/JAWT.java"> <srcfiles refid="stub.includes.dependencies.fileset.1" /> <srcfiles refid="stub.includes.dependencies.fileset.2" /> <srcfiles refid="stub.includes.dependencies.fileset.3" /> @@ -344,8 +221,8 @@ <target name="java.generate.windowlib" if="windowlib.os.cfg"> <echo message="Generating Windowing Lib implementation class" /> - <gluegen src="${stub.includes.dir}/${window.os.system}/window-lib.c" - outputRootDir="../${rootrel.build.nativewindow}" + <gluegen src="${stub.includes}/${window.os.system}/window-lib.c" + outputRootDir="${build.nativewindow}" config="${windowlib.os.cfg}" includeRefid="stub.includes.fileset.platform" emitter="com.sun.gluegen.JavaEmitter"> @@ -353,7 +230,7 @@ </gluegen> <copy todir="${src.generated.java-cdc}"> <fileset dir="${src.generated.java}" - includes="com/sun/nativewindow/impl/x11/**" /> + includes="com/jogamp/nativewindow/impl/x11/**" /> </copy> </target> @@ -364,22 +241,22 @@ <echo message="Generating JAWT interface class" /> <echo message="java.home.dir=${java.home.dir}" /> <gluegen src="${jawt.platform.header}" - outputRootDir="../${rootrel.build.nativewindow}" + outputRootDir="${build.nativewindow}" config="${jawt.cfg}" - literalInclude="${stub.includes.dir}/jni" + literalInclude="${stub.includes}/jni" includeRefid="stub.includes.fileset.platform" emitter="com.sun.gluegen.JavaEmitter"> <classpath refid="gluegen.classpath" /> </gluegen> <copy todir="${src.generated.java-cdc}"> <fileset dir="${src.generated.java}" - includes="com/sun/nativewindow/impl/jawt/**" /> + includes="com/jogamp/nativewindow/impl/jawt/**" /> </copy> </target> <target name="java.generate.platforms" > <echo message="Generating platform-specifics: os: ${window.os.system}, cfgs: ${windowlib.os.cfg}, ${jawt.cfg}" /> - <dirset id="stub.includes.fileset.platform" dir="." includes="${stub.includes.dir}/${window.os.system}/** ${stub.includes.dir}/common/**" /> + <dirset id="stub.includes.fileset.platform" dir="." includes="${stub.includes}/${window.os.system}/** ${stub.includes}/common/**" /> <antcall target="java.generate.windowlib" inheritRefs="true" /> <antcall target="java.generate.jawt" inheritRefs="true" /> </target> @@ -389,7 +266,7 @@ - from the C GL headers. This involves setting the taskdef and creating - the classpath reference id then running the task on each header. --> - <target name="java.generate" depends="build.gluegen, java.generate.check" unless="java.generate.skip"> + <target name="java.generate" depends="common.gluegen.build, java.generate.check" unless="java.generate.skip"> <!-- Add the GlueGen and BuildStaticGLInfo tasks to ANT --> <taskdef name="gluegen" classname="com.sun.gluegen.ant.GlueGenTask" @@ -403,23 +280,23 @@ <echo message="Generating platform-specifics: X11" /> <antcall target="java.generate.platforms" inheritRefs="true"> <param name="window.os.system" value="x11"/> - <param name="windowlib.os.cfg" value="${config}/x11-lib.cfg" /> - <param name="jawt.cfg" value="${config}/jawt-x11.cfg" /> - <param name="jawt.platform.header" value="${stub.includes.dir}/jni/x11/jawt_md.h" /> + <param name="windowlib.os.cfg" value="${config.nativewindow}/x11-lib.cfg" /> + <param name="jawt.cfg" value="${config.nativewindow}/jawt-x11.cfg" /> + <param name="jawt.platform.header" value="${stub.includes}/jni/x11/jawt_md.h" /> </antcall> <echo message="Generating platform-specifics: Win32" /> <antcall target="java.generate.platforms" inheritRefs="true"> <param name="window.os.system" value="win32"/> - <param name="jawt.cfg" value="${config}/jawt-win32.cfg" /> - <param name="jawt.platform.header" value="${stub.includes.dir}/jni/win32/jawt_md.h" /> + <param name="jawt.cfg" value="${config.nativewindow}/jawt-win32.cfg" /> + <param name="jawt.platform.header" value="${stub.includes}/jni/win32/jawt_md.h" /> </antcall> <echo message="Generating platform-specifics: MaxOsX" /> <antcall target="java.generate.platforms" inheritRefs="true"> <param name="window.os.system" value="macosx"/> - <param name="jawt.cfg" value="${config}/jawt-macosx.cfg" /> - <param name="jawt.platform.header" value="${stub.includes.dir}/jni/macosx/jawt_md.h" /> + <param name="jawt.cfg" value="${config.nativewindow}/jawt-macosx.cfg" /> + <param name="jawt.platform.header" value="${stub.includes}/jni/macosx/jawt_md.h" /> </antcall> <!-- Inform the user that the generators have successfully created @@ -438,11 +315,12 @@ <!-- Perform the first pass Java compile; everything --> <javac destdir="${classes-cdc}" excludes="${java.part.awt} ${java.excludes.all}" - source="${nativewindow.sourcelevel}" + source="${target.sourcelevel}" classpath="${gluegen-rt-cdc.jar}" bootclasspath="${javac.bootclasspath-cdc.jar}" fork="yes" - memoryMaximumSize="128m" + includeAntRuntime="false" + memoryMaximumSize="${javac.memorymax}" debug="${javacdebug}" debuglevel="${javacdebuglevel}"> <src path="${src.java}" /> <src path="${src.generated.java-cdc}" /> @@ -453,10 +331,11 @@ <!-- Perform the second pass Java compile; everything. --> <javac destdir="${classes}" excludes="${java.excludes.all}" - source="${nativewindow.sourcelevel}" + source="${target.sourcelevel}" classpath="${gluegen-rt.jar}" fork="yes" - memoryMaximumSize="128m" + includeAntRuntime="false" + memoryMaximumSize="${javac.memorymax}" debug="${javacdebug}" debuglevel="${javacdebuglevel}"> <src path="${src.java}" /> <src path="${src.generated.java}" /> @@ -638,10 +517,6 @@ </and> </condition> - <patternset id="c.src.files.jvm"> - <include name="${rootrel.src.c}/JVM*.c"/> - </patternset> - <patternset id="c.src.files.awt"> <include name="${rootrel.src.c}/JAWT*.c"/> <include name="${rootrel.generated.c}/X11/JAWT*.c" if="isX11"/> @@ -651,6 +526,7 @@ <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"/> <!-- Xinerama supporting functions for Linux only (for now) --> <!-- Also supported on Solaris, but works differently --> @@ -660,8 +536,8 @@ <echo message="Compiling @{output.lib.name}" /> <cc outtype="shared" - objdir="${obj}" - outfile="${obj}/@{output.lib.name}" + objdir="${obj.nativewindow}" + outfile="${obj.nativewindow}/@{output.lib.name}" optimize="${c.compiler.optimise}" debug="${c.compiler.debug}" multithreaded="true" @@ -700,16 +576,16 @@ <!-- 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}/obj/lib@{output.lib.name}.dylib" /> - <param name="dest" value="${build}/obj/lib@{output.lib.name}.jnilib" /> - <param name="dest-cdc" value="${build}/obj/lib@{output.lib.name}.so" /> + <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}/obj/lib@{output.lib.name}.so" /> - <param name="dest" value="${build}/obj/@{output.lib.name}.dll" /> + <param name="src" value="${build.nativewindow}/obj/lib@{output.lib.name}.so" /> + <param name="dest" value="${build.nativewindow}/obj/@{output.lib.name}.dll" /> </antcall> </sequential> </macrodef> @@ -724,17 +600,10 @@ <arg value="/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Libraries/libjawt.dylib" /> <arg value="/System/Library/Frameworks/JavaVM.framework/Libraries/libjawt.dylib" /> <srcfile /> - <fileset dir="${obj}" includes="libnativewindow_awt.jnilib" /> + <fileset dir="${obj.nativewindow}" includes="libnativewindow_awt.jnilib" /> </apply> </target> - <target name="c.build.nativewindow.jvm"> - <c.build c.compiler.src.files="c.src.files.jvm" - output.lib.name="nativewindow_jvm" - compiler.cfg.id="${compiler.cfg.id}" - linker.cfg.id="${linker.cfg.id.base}"/> - </target> - <target name="c.build.nativewindow.awt" unless="setup.noNativeAWT"> <c.build c.compiler.src.files="c.src.files.awt" c.compiler.use-jawt="true" @@ -744,6 +613,8 @@ </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" /> + <c.build c.compiler.src.files="c.src.files.x11" output.lib.name="nativewindow_x11" compiler.cfg.id="${compiler.cfg.id}" @@ -754,21 +625,24 @@ <target name="c.manifest" if="isVC8Family"> <!-- exec mt, the Microsoft Manifest Tool, to include DLL manifests in order to resolve the location of msvcr80.dll --> - <msvc.manifest objdir="${obj}" dllname="nativewindow_jvm" /> - <msvc.manifest objdir="${obj}" dllname="nativewindow_awt" /> + <msvc.manifest objdir="${obj.nativewindow}" dllname="nativewindow_awt" /> </target> - <target name="c.build.nativewindow" depends="c.configure,c.build.nativewindow.windowlib,c.build.nativewindow.jvm,c.build.nativewindow.awt"> + <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" /> <!-- Create the Java Web Start jar file for the built native code --> - <jar destfile="${build}/nativewindow-natives-${os.and.arch}.jar" filesonly="true"> - <fileset dir="${obj}"> + <jar destfile="${build.nativewindow}/nativewindow-natives-${os.and.arch}.jar" filesonly="true"> + <fileset dir="${obj.nativewindow}"> <include name="*.${native.library.suffix}" /> </fileset> </jar> - <jar destfile="${build}/nativewindow-natives-${os.and.arch}-cdc.jar" filesonly="true"> - <fileset dir="${obj}"> + <jar 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> @@ -835,39 +709,39 @@ </target> <target name="build-jars-x11" depends="setup-manifestfile"> - <jar manifest="tempversion" destfile="${nativewindow.x11.jar}" filesonly="true"> + <jar manifest="tempversion" destfile="${nativewindow.os.x11.jar}" filesonly="true"> <fileset dir="${classes}" includes="${java.part.x11}" /> </jar> </target> <target name="build-jars-x11-cdc" depends="setup-manifestfile-cdc"> - <jar manifest="tempversion-cdc" destfile="${nativewindow.x11.cdc.jar}" filesonly="true"> + <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-all" depends="setup-manifestfile" unless="setup.noall"> + <target name="build-jars-all" depends="setup-manifestfile" unless="setup.noAWT"> <jar manifest="tempversion" destfile="${nativewindow.all.jar}" filesonly="true"> - <fileset dir="${classes}"> - <include name="javax/media/nativewindow/**" /> - <include name="com/sun/nativewindow/**" /> - <include name="com/sun/gluegen/runtime/**" /> - <exclude name="${java.part.x11}" /> - </fileset> + <fileset dir="${classes}" + includes="javax/media/nativewindow/** com/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/**" + 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}"> - <include name="javax/media/nativewindow/**" /> - <include name="com/sun/nativewindow/**" /> - <include name="com/sun/gluegen/runtime/**" /> - </fileset> + <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-all"> + <target name="build-jars-javase" depends="setup-manifestfile,build-jars-awt,build-jars-x11,build-jars-all,build-jars-all-noawt"> <jar manifest="tempversion" destfile="${nativewindow.core.jar}" filesonly="true"> <fileset dir="${classes}" includes="${java.part.core}" @@ -889,11 +763,11 @@ <!-- ================================================================== --> <!-- - Build the Javadocs for the sources. - - NOTE: these are not entirely correct as the javadocs targets depend + - NOTE: these are not entirely correct as the javadoc targets depend - on the platform specific build targets. To circumvent any - errors, ensure that the source is built first. --> - <target name="javadoc" depends="load.user.properties,init"> + <target name="javadoc" depends="init"> <!-- Build the general public Javadoc --> <javadoc packagenames="${javadoc.packagenames}" excludepackagenames="${java.excludes.javadoc.packagenames}" @@ -907,7 +781,7 @@ </javadoc> </target> - <target name="javadoc.spec" depends="load.user.properties,init"> + <target name="javadoc.spec" depends="init"> <!-- Build the specification Javadoc --> <javadoc packagenames="${javadoc.spec.packagenames}" excludepackagenames="${java.excludes.javadoc.packagenames}" @@ -921,7 +795,7 @@ </javadoc> </target> - <target name="javadoc.dev" depends="load.user.properties,init"> + <target name="javadoc.dev" depends="init"> <!-- Build the internal developer Javadoc --> <javadoc packagenames="${javadoc.dev.packagenames}" excludepackagenames="${java.excludes.javadoc.packagenames}" @@ -943,7 +817,7 @@ --> <target name="clean" description="Remove all build products" depends="declare.common"> <delete includeEmptyDirs="true" quiet="true"> - <fileset dir="${build}" /> + <fileset dir="${build.nativewindow}" /> <fileset dir="${javadoc}" /> <fileset dir="${javadoc.spec}" /> <fileset dir="${javadoc.dev}" /> @@ -954,22 +828,11 @@ <!-- - Build everything. --> - <target name="all" description="Build NativeWindow JAR file(s) and native libraries." depends="load.user.properties,init,jar,c.build.nativewindow,generate.version.txt" /> - - <target name="setup-version-RI" if="nativewindow.ri"> - <property name="tmp.version" value="${nativewindow_base_version}" /> - </target> - - <target name="setup-version-non-RI" unless="nativewindow.ri"> - <tstamp> - <format property="version.timestamp" pattern="yyyyMMdd"/> - </tstamp> - <property name="tmp.version" value="${nativewindow_base_version}-pre-${version.timestamp}" /> - </target> + <target name="all" description="Build NativeWindow JAR file(s) and native libraries." depends="init,jar,c.build.nativewindow,generate.version.txt" /> - <target name="generate.version.txt" depends="setup-version-RI,setup-version-non-RI"> + <target name="generate.version.txt" depends="init"> <!-- Create a version.txt file indicating which version we just built --> - <echo message="${tmp.version}" file="${build}/version.txt" /> + <echo message="${nativewindow.version}" file="${build.nativewindow}/version.txt" /> </target> <!-- ================================================================== --> diff --git a/make/build-newt.xml b/make/build-newt.xml index ad04973e4..db357bf37 100644 --- a/make/build-newt.xml +++ b/make/build-newt.xml @@ -27,14 +27,14 @@ - Java and C file generators. Note that it is only supported - to create the Javadoc for the platform on which you are - currently running. - - + - - Note: on Windows the "win32.c.compiler" property in newt.properties - is required to select the appropriate C compiler. See the example - newt.properties in this directory for valid values. On Mac OS X - universal binaries may also be built by setting the "macosxfat" - property in newt.properties; again see the example file in this - directory. - - + - - Thanks to Rob Grzywinski and Artur Biesiadowski for the bulk of the - ANT build, including the GlueGen and StaticGLInfo tasks, the building of - the Java generated sources, the first and second phase Java compiles, and @@ -56,31 +56,13 @@ --> <project name="NEWT" basedir="." default="all"> - <import file="versions.xml" /> - - <!-- Pull in GlueGen cpptasks build file --> - <property name="gluegen.root" value="../../gluegen" /> - <import file="${gluegen.root}/make/gluegen-cpptasks.xml" /> + <import file="build-common.xml"/> <!-- ================================================================== --> - <!-- + <!-- - Base initialization and detection of operating system. --> - <target name="base.init" depends="gluegen.cpptasks.detect.os"> - - <property name="javac.bootclasspath-cdc.jar" value="../../gluegen/make/lib/cdc_fp.jar"/> - - <condition property="setup.nodesktop"> - <and> - <isfalse value="${isWindows}" /> - <isfalse value="${isOSX}" /> - <isfalse value="${isX11}" /> - </and> - </condition> - - <condition property="setup.noall"> - <isset property="setup.noAWT"/> - </condition> + <target name="base.init" depends="common.init"> <condition property="setup.nonatives"> <and> @@ -93,184 +75,82 @@ </and> </condition> - <echo message="setup.nonatives: ${setup.nonatives}" /> - <echo message="setup.nodesktop: ${setup.nodesktop}" /> - <echo message="setup.noall: ${setup.noall}" /> - <echo message="setup.noCDC: ${setup.noCDC}" /> - <echo message="setup.noAWT: ${setup.noAWT}" /> <echo message="setup.noOpenGL: ${setup.noOpenGL}" /> - <echo message="javac.bootclasspath-cdc.jar: ${javac.bootclasspath-cdc.jar}" /> + <echo message="isWindows: ${isWindows}" /> + <echo message="isOSX: ${isOSX}" /> <echo message="isX11: ${isX11}" /> <echo message="useKD: ${useKD}" /> <echo message="useIntelGDL: ${useIntelGDL}" /> <echo message="useBroadcomEGL: ${useBroadcomEGL}" /> + <echo message="setup.nonatives: ${setup.nonatives}" /> <!-- partitioning --> <property name="java.part.core" - value="com/sun/javafx/newt/*, com/sun/javafx/newt/util/*, com/sun/javafx/newt/impl/*, com/sun/javafx/newt/intel/gdl/*"/> + value="com/jogamp/newt/*, com/jogamp/newt/util/*, com/jogamp/newt/impl/*, com/jogamp/newt/intel/gdl/*"/> <property name="java.part.x11" - value="com/sun/javafx/newt/x11/*"/> + value="com/jogamp/newt/x11/*"/> <property name="java.part.windows" - value="com/sun/javafx/newt/windows/*"/> + value="com/jogamp/newt/windows/*"/> <property name="java.part.macosx" - value="com/sun/javafx/newt/macosx/*"/> + value="com/jogamp/newt/macosx/*"/> <property name="java.part.opengl" - value="com/sun/javafx/newt/opengl/*, com/sun/javafx/newt/opengl/kd/*"/> + value="com/jogamp/newt/opengl/*, com/jogamp/newt/opengl/kd/*"/> <property name="java.part.broadcomegl" - value="com/sun/javafx/newt/opengl/broadcom/egl/*"/> + value="com/jogamp/newt/opengl/broadcom/egl/*"/> <property name="java.part.awt" - value="com/sun/javafx/newt/awt/*"/> + value="com/jogamp/newt/awt/*"/> <!-- condition excludes --> <condition property="java.excludes.awt" value="${java.part.awt}"> - <isset property="setup.noAWT"/> + <isset property="setup.noAWT"/> </condition> <condition property="java.excludes.opengl" value="${java.part.opengl} ${java.part.broadcomegl}"> - <isset property="setup.noOpenGL"/> + <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"/> + <isset property="setup.nodesktop"/> </condition> <property name="java.excludes.all" value="${java.excludes.awt}, ${java.excludes.opengl} ${java.excludes.desktop}" /> <echo message="java.excludes.all: ${java.excludes.all}" /> - - <!-- Set the project root directory to be up one directory. --> - <property name="project.root" value=".." /> - - <!-- Set the configuration and build files to this directory. --> - <property name="make" value="." /> - </target> - - <target name="base.init.sourcelevel.1"> - <property name="newt.sourcelevel" value="1.4" /> </target> - <!--target name="base.init.sourcelevel.2" if="gluegen.nsig"> - <property name="newt.sourcelevel" value="1.5" /> - </target--> - <!-- ================================================================== --> - <!-- - - Load user properties which override build defaults. - --> - <target name="load.user.properties" depends="base.init,base.init.sourcelevel.1" unless="user.properties.file"> - <!-- Load the user specified properties file that defines various host - - specific paths. The user will be notified if this is does not - - exist. --> - <property name="user.properties.file" value="${user.home}/newt.properties" /> - <property file="${user.properties.file}" /> - <echo message="Loaded ${user.properties.file}." /> - <property file="${user.home}/gluegen.properties" /> - <echo message="Loaded ${user.home}/gluegen.properties." /> - </target> - - <!-- ================================================================== --> - <!-- + <!-- - Declare all paths and user defined variables. --> - <target name="declare.common" description="Declare properties" depends="load.user.properties"> - <!-- The location and name of the configuration ANT file that will - - validate to ensure that all user-define variables are set. --> - <property name="validate.user.properties" value="${make}/validate-properties.xml" /> - - <!-- 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" /> - - <!-- Names of directories relative to the project root. - Some of these are used in FileMappers later for dependence information - and need exact string matching, which is why they use file.separator - instead of "/". --> - <condition property="rootrel.build" value="build"> - <not> - <isset property="rootrel.build"/> - </not> - </condition> - <property name="rootrel.build.newt" value="${rootrel.build}/newt" /> + <target name="declare.common" description="Declare properties" depends="base.init"> <property name="rootrel.src" value="src/newt" /> <property name="rootrel.src.java" value="${rootrel.src}/classes" /> <property name="rootrel.src.c" value="${rootrel.src}/native" /> - <property name="rootrel.obj" value="${rootrel.build.newt}/obj" /> - - <property name="gluegen-rt.jar" value="../../gluegen/${rootrel.build}/gluegen-rt.jar" /> - <property name="nativewindow.core.jar" value="../${rootrel.build}/nativewindow/nativewindow.core.jar" /> - <property name="nativewindow.x11.jar" value="../${rootrel.build}/nativewindow/nativewindow.x11.jar" /> - <property name="nativewindow.awt.jar" value="../${rootrel.build}/nativewindow/nativewindow.awt.jar" /> - <property name="jogl.core.jar" value="../${rootrel.build}/jogl/jogl.core.jar" /> - <property name="jogl.egl.jar" value="../${rootrel.build}/jogl/jogl.egl.jar" /> - - <property name="gluegen-rt-cdc.jar" value="../../gluegen/${rootrel.build}/gluegen-rt-cdc.jar" /> - <property name="nativewindow.core.cdc.jar" value="../${rootrel.build}/nativewindow/nativewindow.core.cdc.jar" /> - <property name="nativewindow.x11.cdc.jar" value="../${rootrel.build}/nativewindow/nativewindow.x11.cdc.jar" /> - <property name="jogl.core.cdc.jar" value="../${rootrel.build}/jogl/jogl.core.cdc.jar" /> - <property name="jogl.egl.cdc.jar" value="../${rootrel.build}/jogl/jogl.egl.cdc.jar" /> <!-- The source directories. --> <property name="src.java" value="${project.root}/${rootrel.src.java}" /> <property name="src.c" value="${project.root}/${rootrel.src.c}" /> - <property name="build" value="${project.root}/${rootrel.build.newt}" /> - + <!-- The generated source directories. --> - <property name="src.generated" value="${build}/gensrc" /> + <property name="src.generated" value="${build.newt}/gensrc" /> <property name="src.generated.c" value="${src.generated}/native/newt" /> <!-- The compiler output directories. --> - <property name="classes" value="${build}/classes" /> - <property name="classes-cdc" value="${build}/classes-cdc" /> - <property name="obj" value="${project.root}/${rootrel.obj}" /> - - <path id="nativewindow_gluegen_jogl.classpath"> - <pathelement location="${gluegen-rt.jar}" /> - <pathelement location="${nativewindow.core.jar}" /> - <pathelement location="${nativewindow.x11.jar}" /> - <pathelement location="${nativewindow.awt.jar}" /> - <pathelement location="${jogl.core.jar}" /> - <pathelement location="${jogl.egl.jar}" /> - </path> - - <path id="nativewindow_gluegen_jogl.classpath-cdc"> - <pathelement location="${gluegen-rt-cdc.jar}" /> - <pathelement location="${nativewindow.core.cdc.jar}" /> - <pathelement location="${nativewindow.x11.cdc.jar}" /> - <pathelement location="${jogl.core.cdc.jar}" /> - <pathelement location="${jogl.egl.cdc.jar}" /> - </path> - - <!-- The resulting newt.jar. --> - <property name="newt.core.jar" value="${build}/newt.core.jar" /> - <property name="newt.x11.jar" value="${build}/newt.x11.jar" /> - <property name="newt.win.jar" value="${build}/newt.win.jar" /> - <property name="newt.osx.jar" value="${build}/newt.osx.jar" /> - <property name="newt.ogl.jar" value="${build}/newt.ogl.jar" /> - <property name="newt.broadcomegl.jar" value="${build}/newt.broadcomegl.jar" /> - <property name="newt.awt.jar" value="${build}/newt.awt.jar" /> - <property name="newt.all.jar" value="${build}/newt.all.jar" /> - <property name="newt.all-noawt.jar" value="${build}/newt.all-noawt.jar" /> - - <property name="newt.core.cdc.jar" value="${build}/newt.core.cdc.jar" /> - <property name="newt.x11.cdc.jar" value="${build}/newt.x11.cdc.jar" /> - <property name="newt.win.cdc.jar" value="${build}/newt.win.cdc.jar" /> - <property name="newt.osx.cdc.jar" value="${build}/newt.osx.cdc.jar" /> - <property name="newt.ogl.cdc.jar" value="${build}/newt.ogl.cdc.jar" /> - <property name="newt.broadcomegl.cdc.jar" value="${build}/newt.broadcomegl.cdc.jar" /> - <property name="newt.all.cdc.jar" value="${build}/newt.all.cdc.jar" /> + <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" /> @@ -279,23 +159,20 @@ <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.sun.javafx.newt, com.sun.javafx.newt.opengl" /> + <property name="javadoc.spec.packagenames" value="com.jogamp.newt, com.jogamp.newt.opengl" /> <property name="javadoc.packagenames" value="${javadoc.spec.packagenames}" /> - <property name="javadoc.dev.packagenames" value="${javadoc.packagenames},com.sun.javafx.newt.*" /> + <property name="javadoc.dev.packagenames" value="${javadoc.packagenames},com.jogamp.newt.*" /> <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> - + <!-- ================================================================== --> - <!-- + <!-- - Initialize all parameters required for the build and create any - required directories. --> <target name="init" depends="declare.common"> - <!-- Call the external config validator script to make sure the config is ok and consistent --> - <ant antfile="${validate.user.properties}" inheritall="true"/> - <mkdir dir="${src.generated.c}" /> <mkdir dir="${src.generated.c}/X11" /> <mkdir dir="${src.generated.c}/MacOSX" /> @@ -305,20 +182,21 @@ <mkdir dir="${src.generated.c}/BroadcomEGL" /> <mkdir dir="${classes}" /> <mkdir dir="${classes-cdc}" /> - <mkdir dir="${obj}" /> + <mkdir dir="${obj.newt}" /> </target> <!-- ================================================================== --> - <!-- + <!-- - Compile the original and generated source. --> <target name="java.compile.javase"> <!-- Perform the second pass Java compile; everything. --> <javac destdir="${classes}" excludes="${java.excludes.all}" - source="${newt.sourcelevel}" + source="${target.sourcelevel}" fork="yes" - memoryMaximumSize="128m" + includeAntRuntime="false" + memoryMaximumSize="${javac.memorymax}" debug="${javacdebug}" debuglevel="${javacdebuglevel}"> <src path="${src.java}" /> <classpath refid="nativewindow_gluegen_jogl.classpath"/> @@ -329,10 +207,11 @@ <!-- Perform the first pass Java compile; everything --> <javac destdir="${classes-cdc}" excludes="${java.excludes.all} ${java.excludes.cdcfp}" - source="${newt.sourcelevel}" + source="${target.sourcelevel}" bootclasspath="${javac.bootclasspath-cdc.jar}" fork="yes" - memoryMaximumSize="128m" + includeAntRuntime="false" + memoryMaximumSize="${javac.memorymax}" debug="${javacdebug}" debuglevel="${javacdebuglevel}"> <classpath refid="nativewindow_gluegen_jogl.classpath-cdc"/> <src path="${src.java}" /> @@ -342,7 +221,7 @@ <target name="java.compile" depends="java.compile.javase,java.compile.javacdc" /> <!-- ================================================================== --> - <!-- + <!-- - Compile the native C code for JOGL (and optionally the Cg binding). --> @@ -356,7 +235,7 @@ </compiler> <!-- linker configuration --> - + <linker id="linker.cfg.linux.newt.broadcom_egl" extends="linker.cfg.linux"> <syslibset dir="/nfsroot/lg/lib" libs="EGL"/> <syslibset dir="/nfsroot/lg/lib" libs="GLES_CM"/> @@ -409,7 +288,7 @@ <property name="linker.cfg.id.core" value="linker.cfg.win32.msvc" /> <property name="linker.cfg.id.oswin" value="linker.cfg.win32.msvc.newt" /> </target> - + <target name="c.configure.win32.mingw" if="isMingW"> <echo message="Win32.MingW" /> <property name="compiler.cfg.id" value="compiler.cfg.win32.mingw" /> @@ -427,7 +306,7 @@ </condition> <echo message="linker.cfg.id.oswin ${linker.cfg.id.oswin}" /> </target> - + <target name="c.configure.linux.amd64" if="isLinuxAMD64"> <echo message="Linux.AMD64" /> <property name="compiler.cfg.id" value="compiler.cfg.linux.amd64" /> @@ -438,7 +317,7 @@ </condition> <echo message="linker.cfg.id.oswin ${linker.cfg.id.oswin}" /> </target> - + <target name="c.configure.linux.ia64" if="isLinuxIA64"> <echo message="Linux.IA64" /> <property name="compiler.cfg.id" value="compiler.cfg.linux" /> @@ -454,15 +333,15 @@ <property name="linker.cfg.id.core" value="linker.cfg.solaris" /> <property name="linker.cfg.id.oswin" value="linker.cfg.solaris.newt.x11" /> </target> - - + + <target name="c.configure.solaris.sparcv9" depends="c.configure.x11" if="isSolarisSparcv9"> <echo message="SolarisSparcv9" /> <property name="compiler.cfg.id" value="compiler.cfg.solaris.sparcv9" /> <property name="linker.cfg.id.core" value="linker.cfg.solaris.sparcv9" /> <property name="linker.cfg.id.oswin" value="linker.cfg.solaris.sparcv9.newt.x11" /> </target> - + <target name="c.configure.solaris.amd64" depends="c.configure.x11" if="isSolarisAMD64"> <echo message="SolarisAMD64" /> @@ -470,7 +349,7 @@ <property name="linker.cfg.id.core" value="linker.cfg.solaris.amd64" /> <property name="linker.cfg.id.oswin" value="linker.cfg.solaris.amd64.newt.x11" /> </target> - + <target name="c.configure.freebsd" depends="c.configure.x11" if="isFreeBSD"> <echo message="FreeBSD" /> <property name="compiler.cfg.id" value="compiler.cfg.freebsd.newt" /> @@ -494,7 +373,7 @@ <property name="linker.cfg.id.core" value="linker.cfg.macosx" /> <property name="linker.cfg.id.oswin" value="linker.cfg.macosx.newt" /> </target> - + <target name="c.configure.2" depends="c.configure.win32,c.configure.linux,c.configure.solaris32,c.configure.solaris.sparcv9,c.configure.solaris.amd64,c.configure.macosx,c.configure.freebsd,c.configure.hpux" /> <target name="c.configure" depends="c.configure.1,c.configure.2" /> @@ -518,9 +397,9 @@ <echo message="Output lib name = @{output.lib.name}" /> <!-- NOTE: the value of the debug and optimise attributes will not be overridden if already set externally --> - <property name="c.compiler.debug" value="false" /> - <!-- Optimise flags one of { none, size, speed, minimal, full, aggressive, extreme, unsafe } --> - <property name="c.compiler.optimise" value="none" /> + <property name="c.compiler.debug" value="false" /> + <!-- Optimise flags one of { none, size, speed, minimal, full, aggressive, extreme, unsafe } --> + <property name="c.compiler.optimise" value="none" /> <condition property="c.compiler.use-debug"><istrue value="${c.compiler.debug}"/></condition> @@ -535,25 +414,25 @@ <echo message="Compiling @{output.lib.name}" /> - <cc outtype="shared" - objdir="${obj}" - outfile="${obj}/@{output.lib.name}" - optimize="${c.compiler.optimise}" + <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"> - + multithreaded="true" + exceptions="false" + rtti="false"> + <!-- TODO: versioninfo companyname="java.net" legalcopyright="Copyright" - productname="JOGL" + productname="JOGL" productversion="x.y.z" description="Description" - fileversion="x.y.z" - filecomments="File Comment" /--> - + fileversion="x.y.z" + filecomments="File Comment" /--> + <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}"/> @@ -567,52 +446,52 @@ <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.dir.platform}" libs="jawt" if="@{output.lib.name}.useLibJAWT"/> - <syslibset dir="${java.lib.dir.platform}/server" libs="jvm" if="@{output.lib.name}.useLibJVM"/> + <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}/obj/lib@{output.lib.name}.dylib" /> - <param name="dest" value="${build}/obj/lib@{output.lib.name}.jnilib" /> - <param name="dest-cdc" value="${build}/obj/lib@{output.lib.name}.so" /> + <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="${build}/obj/lib@{output.lib.name}.so" /> - <param name="dest" value="${build}/obj/@{output.lib.name}.dll" /> + <param name="src" value="${obj.newt}/lib@{output.lib.name}.so" /> + <param name="dest" value="${obj.newt}/@{output.lib.name}.dll" /> </antcall> </sequential> - </macrodef> + </macrodef> <target name="c.build.newt.prepare.KD" if="useKD"> - <javah destdir="${src.generated.c}/KD" classpath="${classes}" class="com.sun.javafx.newt.opengl.kd.KDWindow" /> + <javah destdir="${src.generated.c}/KD" classpath="${classes}" class="com.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.sun.javafx.newt.intel.gdl.Display" /> - <javah destdir="${src.generated.c}/IntelGDL" classpath="${classes}" class="com.sun.javafx.newt.intel.gdl.Screen" /> - <javah destdir="${src.generated.c}/IntelGDL" classpath="${classes}" class="com.sun.javafx.newt.intel.gdl.Window" /> + <javah destdir="${src.generated.c}/IntelGDL" classpath="${classes}" class="com.jogamp.newt.intel.gdl.Display" /> + <javah destdir="${src.generated.c}/IntelGDL" classpath="${classes}" class="com.jogamp.newt.intel.gdl.Screen" /> + <javah destdir="${src.generated.c}/IntelGDL" classpath="${classes}" class="com.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.sun.javafx.newt.opengl.broadcom.egl.Window" /> + <javah destdir="${src.generated.c}/BroadcomEGL" classpath="${classes}" class="com.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.sun.javafx.newt.windows.WindowsWindow" /> - <javah destdir="${src.generated.c}/MacOSX" classpath="${classes}" class="com.sun.javafx.newt.macosx.MacWindow" /> - <javah destdir="${src.generated.c}/X11" classpath="${classes}" class="com.sun.javafx.newt.x11.X11Window" /> + <javah destdir="${src.generated.c}/Windows" classpath="${classes}" class="com.jogamp.newt.windows.WindowsWindow" /> + <javah destdir="${src.generated.c}/MacOSX" classpath="${classes}" class="com.jogamp.newt.macosx.MacWindow" /> + <javah destdir="${src.generated.c}/X11" classpath="${classes}" class="com.jogamp.newt.x11.X11Window" /> </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" /> @@ -626,22 +505,26 @@ <target name="c.manifest" if="isVC8Family"> <!-- exec mt, the Microsoft Manifest Tool, to include DLL manifests in order to resolve the location of msvcr80.dll --> - <msvc.manifest objdir="${obj}" dllname="newt" /> + <msvc.manifest objdir="${obj.newt}" dllname="newt" /> </target> <target name="c.build.newt.natives" depends="c.build.newt.windowlib" unless="setup.nonatives"> </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" /> <!-- Create the Java Web Start jar file for the built native code --> - <jar destfile="${build}/newt-natives-${os.and.arch}.jar" filesonly="true"> - <fileset dir="${obj}"> + <jar destfile="${build.newt}/newt-natives-${os.and.arch}.jar" filesonly="true"> + <fileset dir="${obj.newt}"> <include name="*.${native.library.suffix}" /> </fileset> </jar> - <jar destfile="${build}/newt-natives-${os.and.arch}-cdc.jar" filesonly="true"> - <fileset dir="${obj}"> + <jar destfile="${build.newt}/newt-natives-${os.and.arch}-cdc.jar" filesonly="true"> + <fileset dir="${obj.newt}"> <include name="*.${native.library.suffix-cdc}" /> </fileset> </jar> @@ -662,14 +545,11 @@ <isset property="newt.ri" /> </not> </condition> - <tstamp> - <format property="timestamp" pattern="yyyyMMdd-HH:mm:ss"/> - </tstamp> <copy file="${manifestfile}" tofile="tempversion" overwrite="true"> <filterset> - <filter token="VERSION" value="${newt_base_version}-pre-${timestamp}"/> + <filter token="VERSION" value="${newt.version}"/> <filter token="BASEVERSION" value="${newt_base_version}"/> </filterset> </copy> @@ -684,14 +564,11 @@ <isset property="newt.ri" /> </not> </condition> - <tstamp> - <format property="timestamp" pattern="yyyyMMdd-HH:mm:ss"/> - </tstamp> <copy file="${manifestfile}" tofile="tempversion-cdc" overwrite="true"> <filterset> - <filter token="VERSION" value="${newt_base_version}-pre-${timestamp}"/> + <filter token="VERSION" value="${newt.version}"/> <filter token="BASEVERSION" value="${newt_base_version}"/> </filterset> </copy> @@ -727,46 +604,46 @@ </target> <target name="build-jars-desktop" depends="setup-manifestfile" unless="setup.nodesktop"> - <jar manifest="tempversion" destfile="${newt.x11.jar}" filesonly="true"> + <jar manifest="tempversion" destfile="${newt.os.x11.jar}" filesonly="true"> <fileset dir="${classes}" includes="${java.part.x11}"/> </jar> - <jar manifest="tempversion" destfile="${newt.win.jar}" filesonly="true"> + <jar manifest="tempversion" destfile="${newt.os.win.jar}" filesonly="true"> <fileset dir="${classes}" includes="${java.part.windows}"/> </jar> - <jar manifest="tempversion" destfile="${newt.osx.jar}" filesonly="true"> + <jar manifest="tempversion" destfile="${newt.os.osx.jar}" filesonly="true"> <fileset dir="${classes}" includes="${java.part.macosx}"/> </jar> </target> <target name="build-jars-desktop-cdc" depends="setup-manifestfile-cdc" unless="setup.nodesktop"> - <jar manifest="tempversion-cdc" destfile="${newt.x11.cdc.jar}" filesonly="true"> + <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.win.cdc.jar}" filesonly="true"> + <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.osx.cdc.jar}" filesonly="true"> + <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.noall"> + <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/sun/javafx/newt/**" /> + includes="com/jogamp/newt/**" /> </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/sun/javafx/newt/**" + includes="com/jogamp/newt/**" excludes="${java.part.awt}" /> </jar> </target> @@ -774,7 +651,7 @@ <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/sun/javafx/newt/**" + includes="com/jogamp/newt/**" excludes="${java.excludes.cdcfp}" /> </jar> </target> @@ -797,17 +674,17 @@ <!-- ================================================================== --> <!-- - Build the Javadocs for the sources. - - NOTE: these are not entirely correct as the javadocs targets depend - - on the platform specific build targets. To circumvent any + - NOTE: these are not entirely correct as the javadocs targets depend + - on the platform specific build targets. To circumvent any - errors, ensure that the source is built first. --> - <target name="javadoc" depends="load.user.properties,init"> + <target name="javadoc" depends="init"> <!-- Build the general Javadoc --> <javadoc packagenames="${javadoc.packagenames}" excludepackagenames="${java.excludes.javadoc.packagenames}" - sourcepath="${src.java};${src.generated.java}" + sourcepath="${src.java};${src.generated.java}" destdir="${javadoc}" windowtitle="${javadoc.windowtitle}" - overview="${javadoc.overview}" + overview="${javadoc.overview}" source="1.4" linkoffline="${javadoc.link} 142-packages" bottom="${javadoc.bottom}" > @@ -815,7 +692,7 @@ </javadoc> </target> - <target name="javadoc.spec" depends="load.user.properties,init"> + <target name="javadoc.spec" depends="init"> <!-- Build the general Javadoc --> <javadoc packagenames="${javadoc.spec.packagenames}" excludepackagenames="${java.excludes.javadoc.packagenames}" @@ -828,14 +705,14 @@ <classpath refid="nativewindow_gluegen_jogl.classpath"/> </javadoc> </target> - - <target name="javadoc.dev" depends="load.user.properties,init"> + + <target name="javadoc.dev" depends="init"> <!-- Build the internal developer Javadoc --> <javadoc packagenames="${javadoc.dev.packagenames}" excludepackagenames="${java.excludes.javadoc.packagenames}" - sourcepath="${src.java};${src.generated.java}" + sourcepath="${src.java};${src.generated.java}" destdir="${javadoc.dev}" windowtitle="${javadoc.windowtitle}" - overview="${javadoc.overview}" + overview="${javadoc.overview}" source="1.4" linkoffline="${javadoc.link} 142-packages" bottom="${javadoc.bottom}" > @@ -851,7 +728,7 @@ --> <target name="clean" description="Remove all build products" depends="declare.common"> <delete includeEmptyDirs="true" quiet="true"> - <fileset dir="${build}" /> + <fileset dir="${build.newt}" /> <fileset dir="${javadoc}" /> <fileset dir="${javadoc.spec}" /> <fileset dir="${javadoc.dev}" /> @@ -862,22 +739,11 @@ <!-- - Build everything. --> - <target name="all" description="Build NEWT JAR file(s) and native libraries." depends="load.user.properties,init,jar,c.build.newt,generate.version.txt" /> - - <target name="setup-version-RI" if="newt.ri"> - <property name="tmp.version" value="${newt_base_version}" /> - </target> - - <target name="setup-version-non-RI" unless="newt.ri"> - <tstamp> - <format property="version.timestamp" pattern="yyyyMMdd"/> - </tstamp> - <property name="tmp.version" value="${newt_base_version}-pre-${version.timestamp}" /> - </target> + <target name="all" description="Build NEWT JAR file(s) and native libraries." depends="init,jar,c.build.newt,generate.version.txt" /> - <target name="generate.version.txt" depends="setup-version-RI,setup-version-non-RI"> + <target name="generate.version.txt" depends="init"> <!-- Create a version.txt file indicating which version we just built --> - <echo message="${tmp.version}" file="${build}/version.txt" /> + <echo message="${newt.version}" file="${build.newt}/version.txt" /> </target> <!-- ================================================================== --> diff --git a/make/build-staticglgen.xml b/make/build-staticglgen.xml index 9ef1147a3..3d5fb2d12 100644 --- a/make/build-staticglgen.xml +++ b/make/build-staticglgen.xml @@ -17,7 +17,7 @@ --> <target name="declare" description="Declare properties"> <!-- The location of the BuildStaticGLInfo source. --> - <property name="static.gl.src" value="${src.java}/com/sun/gluegen/opengl" /> + <property name="static.gl.src" value="${src.java}/com/jogamp/gluegen/opengl" /> </target> <!-- ================================================================== --> @@ -29,7 +29,8 @@ <mkdir dir="${classes}" /> <!-- Compile BuildStaticGLInfo --> - <javac srcdir="${src.java}" destdir="${classes}" includes="**/BuildStaticGLInfo.java" source="1.4" debug="true" debuglevel="source,lines"> + <javac srcdir="${src.java}" destdir="${classes}" includes="**/BuildStaticGLInfo.java" source="1.4" debug="true" debuglevel="source,lines" + includeAntRuntime="false"> <classpath refid="antlr.classpath" /> </javac> @@ -49,8 +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="source,lines"> - <src path="${src.java}" /> + <javac destdir="${classes}" includes="**/StaticGLGenTask.java" source="1.4" debug="true" debuglevel="source,lines" + includeAntRuntime="false"> + <src path="${src.java}" /> <classpath refid="classpath" /> </javac> @@ -88,4 +90,4 @@ <antcall target="build.static.gl.task" /> </target> -</project>
\ No newline at end of file +</project> diff --git a/make/build.xml b/make/build.xml index 28936ef52..8d2c9765a 100644 --- a/make/build.xml +++ b/make/build.xml @@ -1,33 +1,9 @@ <project name="JOGL_ALL" basedir="." default="all"> - <import file="versions.xml" /> - - <!-- Pull in GlueGen cpptasks build file to pick up os.and.arch --> - <property name="gluegen.root" value="../../gluegen" /> - <import file="${gluegen.root}/make/gluegen-cpptasks.xml" /> - - <target name="init"> - <property name="project.root" value=".." /> - <condition property="rootrel.build" value="build"> - <not> - <isset property="rootrel.build"/> - </not> - </condition> - <property name="build" value="${project.root}/${rootrel.build}" /> - <property name="src" value="${project.root}/src" /> - - <property name="nativewindow.make.dir" value="." /> - <property name="nativewindow.build.xml" value="${nativewindow.make.dir}/build-nativewindow.xml" /> - <property name="jogl.make.dir" value="." /> - <property name="jogl.build.xml" value="${jogl.make.dir}/build-jogl.xml" /> - <property name="newt.make.dir" value="." /> - <property name="newt.build.xml" value="${newt.make.dir}/build-newt.xml" /> - - <property name="all.srcj.path" value="${src}/nativewindow/classes;${src}/jogl/classes;${src}/newt/classes" /> - <!-- No generated classes for Newt at the present time --> - <property name="all.genj.path" value="${build}/nativewindow/gensrc/classes;${build}/jogl/gensrc/classes" /> + <import file="build-common.xml"/> + <target name="init" depends="common.init"> <!-- The javadoc dirs. --> <property name="javadoc" value="${project.root}/javadoc_public" /> <property name="javadoc.link" value="http://java.sun.com/j2se/1.4.2/docs/api/" /> @@ -43,47 +19,33 @@ <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.sun.opengl.util.*,com.sun.javafx.newt, com.sun.javafx.newt.opengl" /> + <property name="javadoc.packagenames" value="${javadoc.nw.spec.packagenames},${javadoc.spec.packagenames},com.jogamp.opengl.util.*,com.jogamp.newt, com.jogamp.newt.opengl" /> <property name="javadoc.dev" value="${project.root}/javadoc_dev" /> - <property name="javadoc.dev.packagenames" value="${javadoc.packagenames},com.sun.opengl.impl.*,com.sun.nativewindow.impl.*,com.sun.javafx.newt.*,com.sun.gluegen,com.sun.gluegen.runtime" /> + <property name="javadoc.dev.packagenames" value="${javadoc.packagenames},com.jogamp.opengl.impl.*,com.jogamp.nativewindow.impl.*,com.jogamp.newt.*,com.sun.gluegen,com.jogamp.gluegen.runtime" /> - <property name="java.excludes.javadoc.packagenames" value="com.sun.opengl.impl.gl2.fixme.*,com.sun.javafx.audio.windows.waveout.TestSpatialization"/> + <property name="java.excludes.javadoc.packagenames" value="com.jogamp.opengl.impl.gl2.fixme.*,com.jogamp.audio.windows.waveout.TestSpatialization"/> <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>." /> - <property name="gluegen.jar" value="../../gluegen/${rootrel.build}/gluegen.jar" /> - <property name="gluegen-rt.jar" value="../../gluegen/${rootrel.build}/gluegen-rt.jar" /> - <property name="nativewindow.all.jar" value="../${rootrel.build}/nativewindow/nativewindow.all.jar" /> - <property name="jogl.all.jar" value="../${rootrel.build}/jogl/jogl.all.jar" /> - <property name="newt.all.jar" value="../${rootrel.build}/newt/newt.all.jar" /> - - <path id="all.classpath"> - <pathelement location="${nativewindow.all.jar}" /> - <pathelement location="${gluegen-rt.jar}" /> - <pathelement location="${jogl.all.jar}" /> - <pathelement location="${newt.all.jar}" /> - </path> - </target> <target name="build.nativewindow" depends="init"> - <ant antfile="${nativewindow.build.xml}" dir="${nativewindow.make.dir}" target="all" inheritAll="false"/> + <ant antfile="${nativewindow.build.xml}" dir="${nativewindow.make}" target="all" inheritRefs="true" inheritAll="true"/> </target> <target name="build.jogl" depends="init"> - <ant antfile="${jogl.build.xml}" dir="${jogl.make.dir}" target="all" inheritAll="false"/> + <ant antfile="${jogl.build.xml}" dir="${jogl.make}" target="all" inheritRefs="true" inheritAll="true"/> </target> <target name="build.newt" depends="init"> - <ant antfile="${newt.build.xml}" dir="${newt.make.dir}" target="all" inheritAll="false"/> + <ant antfile="${newt.build.xml}" dir="${newt.make}" target="all" inheritRefs="true" inheritAll="true"/> </target> <target name="one-lib-dir" depends="init,gluegen.cpptasks.detect.os"> - <property name="lib.dir" value="${build}/lib" /> - <delete includeEmptyDirs="true" quiet="true" dir="${lib.dir}" failonerror="false" /> - <mkdir dir="${lib.dir}" /> - <copy todir="${lib.dir}"> - <fileset dir="${project.root}/../gluegen/${rootrel.build}/obj" includes="*.${native.library.suffix} *.${native.library.suffix-cdc}" /> + <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}" /> @@ -96,38 +58,25 @@ - This must be called after all of the build targets complete. --> - <target name="setup-version-RI" if="jogl.ri"> - <property name="tmp.version" value="${jogl_base_version}" /> - </target> - - <target name="setup-version-non-RI" unless="jogl.ri"> - <tstamp> - <format property="timestamp" pattern="yyyyMMdd"/> - </tstamp> - <property name="tmp.version" value="${jogl_base_version}-pre-${timestamp}" /> - </target> - - <target name="developer-zip-archive" depends="gluegen.cpptasks.detect.os,setup-version-RI,setup-version-non-RI" unless="build.noarchives"> - <property name="archive.name" value="jogl-${tmp.version}-${os.and.arch}" /> - <property name="archive.dir" value="${build}/${archive.name}" /> - <delete includeEmptyDirs="true" quiet="true" dir="${archive.dir}" failonerror="false" /> - <mkdir dir="${archive.dir}" /> + <target name="developer-zip-archive" depends="init" unless="build.noarchives"> + <delete includeEmptyDirs="true" quiet="true" dir="${archive}" failonerror="false" /> + <mkdir dir="${archive}" /> <!-- Copy the appropriate pieces into the archive directory --> - <copy file="../CHANGELOG.txt" todir="${archive.dir}" /> - <copy file="../COPYRIGHT.txt" todir="${archive.dir}" /> - <copy file="../LICENSE.txt" todir="${archive.dir}" /> - <copy file="../doc/userguide/index.html" tofile="${archive.dir}/Userguide.html" /> + <copy file="../CHANGELOG.txt" todir="${archive}" /> + <copy file="../COPYRIGHT.txt" todir="${archive}" /> + <copy file="../LICENSE.txt" todir="${archive}" /> + <copy file="../doc/userguide/index.html" tofile="${archive}/Userguide.html" /> <copy file="README-zip-bundles.txt" - tofile="${archive.dir}/README.txt" + tofile="${archive}/README.txt" overwrite="true"> <filterset> - <filter token="VERSION" value="${tmp.version}"/> + <filter token="VERSION" value="${jogl.version}"/> </filterset> </copy> - <mkdir dir="${archive.dir}/lib" /> - <copy todir="${archive.dir}/lib"> - <fileset dir="${project.root}/../gluegen/${rootrel.build}" includes="gluegen-rt.jar gluegen-rt-cdc.jar" /> - <fileset dir="${project.root}/../gluegen/${rootrel.build}/obj" includes="*.${native.library.suffix} *.${native.library.suffix-cdc}" /> + <mkdir dir="${archive}/lib" /> + <copy todir="${archive}/lib"> + <fileset dir="${gluegen.root}/${rootrel.build}" includes="gluegen-rt.jar gluegen-rt-cdc.jar" /> + <fileset dir="${gluegen.root}/${rootrel.build}/obj" includes="*.${native.library.suffix} *.${native.library.suffix-cdc}" /> <fileset dir="${build}/jogl" includes="*.jar" excludes="*natives*.jar" /> <fileset dir="${build}/jogl/obj" includes="*.${native.library.suffix} *.${native.library.suffix-cdc}" /> <fileset dir="${build}/nativewindow" includes="*.jar" excludes="*natives*.jar" /> @@ -135,8 +84,8 @@ <fileset dir="${build}/newt" includes="*.jar" excludes="*natives*.jar" /> <fileset dir="${build}/newt/obj" includes="*.${native.library.suffix} *.${native.library.suffix-cdc}" /> </copy> - <mkdir dir="${archive.dir}/etc" /> - <copy todir="${archive.dir}/etc"> + <mkdir dir="${archive}/etc" /> + <copy todir="${archive}/etc"> <fileset dir="${project.root}/etc" includes="*" /> </copy> <delete quiet="true" file="${build}/${archive.name}.zip"/> @@ -144,7 +93,7 @@ basedir="${build}" includes="${archive.name}/**" /> <!-- Clean up after ourselves --> - <delete includeEmptyDirs="true" quiet="true" dir="${archive.dir}" failonerror="false" /> + <delete includeEmptyDirs="true" quiet="true" dir="${archive}" failonerror="false" /> </target> <!-- ================================================================== --> @@ -153,20 +102,20 @@ - This must be called after all of the build targets complete. --> - <target name="source-archive" depends="setup-version-RI,setup-version-non-RI" unless="build.noarchives"> + <target name="source-archive" depends="init" unless="build.noarchives"> <!-- NOTE that if you are using multiple rootrel.build directories within the same repository, the exclude lists here won't work well enough and you will wind up archiving binary bits from other rootrel.build settings in the source archive. This is inevitable given that we don't want to specialize this target to explicitly include top level files and directories, to make it future-proof. --> - <delete quiet="true" file="${build}/jogl-${tmp.version}-src.zip"/> - <zip destfile="${build}/jogl-${tmp.version}-src.zip" + <delete quiet="true" file="${build}/jogl-${jogl.version}-src.zip"/> + <zip destfile="${build}/jogl-${jogl.version}-src.zip" basedir="${project.root}/.." - excludes="gluegen/${rootrel.build}/**,gluegen/build/**gluegen/build-temp/**,jogl/${rootrel.build}/**,jogl/build/**,jogl/build-temp/**,jogl/www/**" - includes="gluegen/**, jogl/**" /> + excludes="${gluegen.root}/${rootrel.build}/**,${gluegen.root}/build/**${gluegen.root}/build-temp/**,jogl/${rootrel.build}/**,jogl/build/**,jogl/build-temp/**,jogl/www/**" + includes="${gluegen.root}/**, jogl/**" /> <!-- Now add in certain portions of the generated source code for developers --> <zip update="true" - destfile="${build}/jogl-${tmp.version}-src.zip" + destfile="${build}/jogl-${jogl.version}-src.zip" basedir="${project.root}/.." includes="jogl/${rootrel.build}/jogl/gensrc/classes/javax/media/opengl/**" /> </target> @@ -176,12 +125,21 @@ - Main build target. --> - <target name="all" description="Build nativewindow, jogl and newt projects" depends="init,build.nativewindow,build.jogl,build.newt,one-lib-dir,developer-zip-archive,source-archive" /> + <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-lib-dir,developer-zip-archive,source-archive" /> + + <target name="junit.compile"> + <ant antfile="build-junit.xml" target="junit.compile" inheritRefs="true" inheritAll="true"/> + </target> + + <target name="test" depends="junit.run"/> + <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> <target name="clean" depends="init"> - <ant antfile="${nativewindow.build.xml}" dir="${nativewindow.make.dir}" target="clean" inheritAll="false"/> - <ant antfile="${jogl.build.xml}" dir="${jogl.make.dir}" target="clean" inheritAll="false"/> - <ant antfile="${newt.build.xml}" dir="${newt.make.dir}" target="clean" inheritAll="false"/> + <ant antfile="${nativewindow.build.xml}" dir="${nativewindow.make}" target="clean" inheritRefs="true" inheritAll="true"/> + <ant antfile="${jogl.build.xml}" dir="${jogl.make}" target="clean" inheritRefs="true" inheritAll="true"/> + <ant antfile="${newt.build.xml}" dir="${newt.make}" target="clean" inheritRefs="true" inheritAll="true"/> <delete includeEmptyDirs="true" quiet="true"> <fileset dir="${build}" /> </delete> @@ -196,10 +154,11 @@ overview="${javadoc.overview}" source="1.4" maxmemory="512m" - bottom="${javadoc.bottom}" > - <classpath refid="all.classpath"/> - <link offline="true" href="${javadoc.link}" packagelistLoc="142-packages" /> - <taglet name="net.highteq.nativetaglet.NativeTaglet" path="${gluegen.jar}" /> + bottom="${javadoc.bottom}" > + <classpath refid="jogl_newt_all.classpath"/> + <link offline="true" href="${javadoc.link}" packagelistLoc="142-packages" /> + <arg line="-J-Dnativetaglet.mapping=${basedir}/native-taglet.properties"/> + <taglet name="net.highteq.nativetaglet.NativeTaglet" path="${gluegen.jar}" /> </javadoc> </target> @@ -213,10 +172,11 @@ source="1.4" maxmemory="512m" bottom="${javadoc.bottom}" > - <classpath refid="all.classpath"/> - <link offline="true" href="${javadoc.link}" packagelistLoc="142-packages" /> - <link offline="false" href="${javadoc.nw.spec}" /> - <taglet name="net.highteq.nativetaglet.NativeTaglet" path="${gluegen.jar}" /> + <classpath refid="jogl_newt_all.classpath"/> + <link offline="true" href="${javadoc.link}" packagelistLoc="142-packages" /> + <arg line="-J-Dnativetaglet.mapping=${basedir}/native-taglet.properties"/> + <link offline="false" href="${javadoc.nw.spec}" /> + <taglet name="net.highteq.nativetaglet.NativeTaglet" path="${gluegen.jar}" /> </javadoc> </target> @@ -229,10 +189,11 @@ overview="${javadoc.overview}" source="1.4" maxmemory="512m" - bottom="${javadoc.bottom}" > - <classpath refid="all.classpath"/> - <link offline="true" href="${javadoc.link}" packagelistLoc="142-packages" /> - <taglet name="net.highteq.nativetaglet.NativeTaglet" path="${gluegen.jar}" /> + bottom="${javadoc.bottom}" > + <classpath refid="jogl_newt_all.classpath"/> + <link offline="true" href="${javadoc.link}" packagelistLoc="142-packages" /> + <arg line="-J-Dnativetaglet.mapping=${basedir}/native-taglet.properties"/> + <taglet name="net.highteq.nativetaglet.NativeTaglet" path="${gluegen.jar}" /> </javadoc> </target> @@ -246,9 +207,10 @@ source="1.4" maxmemory="512m" bottom="${javadoc.bottom}" > - <classpath refid="all.classpath"/> - <link offline="true" href="${javadoc.link}" packagelistLoc="142-packages" /> - <taglet name="net.highteq.nativetaglet.NativeTaglet" path="${gluegen.jar}" /> + <classpath refid="jogl_newt_all.classpath"/> + <link offline="true" href="${javadoc.link}" packagelistLoc="142-packages" /> + <arg line="-J-Dnativetaglet.mapping=${basedir}/native-taglet.properties"/> + <taglet name="net.highteq.nativetaglet.NativeTaglet" path="${gluegen.jar}" /> </javadoc> </target> diff --git a/make/config/jogl/cg-common-CustomJavaCode.java b/make/config/jogl/cg-common-CustomJavaCode.java index 1f109d9f6..d1e4f8bf5 100755 --- a/make/config/jogl/cg-common-CustomJavaCode.java +++ b/make/config/jogl/cg-common-CustomJavaCode.java @@ -1,5 +1,5 @@ static { - com.sun.opengl.impl.NativeLibLoader.loadCgImpl(); + com.jogamp.opengl.impl.GLJNILibLoader.loadCgImpl(); } /** A convenience method which reads all available data from the InputStream and then calls cgCreateProgram. */ diff --git a/make/config/jogl/cg-common.cfg b/make/config/jogl/cg-common.cfg index 9b8dba079..927d233a8 100644 --- a/make/config/jogl/cg-common.cfg +++ b/make/config/jogl/cg-common.cfg @@ -1,6 +1,6 @@ # This .cfg file provides common options used among all Cg glue code # generated for Jogl on all platforms. -Package com.sun.opengl.cg +Package com.jogamp.opengl.cg JavaClass CgGL Style AllStatic JavaOutputDir gensrc/classes @@ -92,12 +92,8 @@ Ignore cgGetIntStateAssignmentValues Ignore cgGetParameterValues Ignore cgGetProgramOptions -# -# Need to import New IO for Buffer classes -# -Import java.nio.* # And NativeLibLoader for help loading the native libraries -Import com.sun.opengl.impl.* +Import com.jogamp.opengl.impl.* # # NIODirectOnly directives for routines requiring them for semantic reasons diff --git a/make/config/jogl/cgl-macosx.cfg b/make/config/jogl/cgl-macosx.cfg index 54b4be171..f2af29e00 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.sun.opengl.impl.macosx.cgl +Package com.jogamp.opengl.impl.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 3bd027c84..404a852b0 100755 --- 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.sun.opengl.impl.macosx.cgl +Package com.jogamp.opengl.impl.macosx.cgl Style InterfaceAndImpl JavaClass CGLExt -ImplPackage com.sun.opengl.impl.macosx.cgl +ImplPackage com.jogamp.opengl.impl.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 bcda00b07..fd65d5c10 100644 --- a/make/config/jogl/egl-common.cfg +++ b/make/config/jogl/egl-common.cfg @@ -4,11 +4,10 @@ GLHeader EGL/egl.h GLHeader EGL/eglext.h # Imports needed by all glue code -Import java.nio.* Import java.util.* Import javax.media.opengl.* Import javax.media.opengl.fixedfunc.* -Import com.sun.opengl.impl.* +Import com.jogamp.opengl.impl.* # 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 26979fb6d..74047072b 100755 --- 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.sun.opengl.impl.egl +Package com.jogamp.opengl.impl.egl JavaClass EGL Style allstatic # Shouldn't matter which one of these we pick up @@ -43,8 +43,8 @@ CustomJavaCode EGL { CustomJavaCode EGL if (eglGetProcAddressHandle == 0) { CustomJavaCode EGL throw new GLException("Passed null pointer for method \"eglGetProcAddress\""); CustomJavaCode EGL } -CustomJavaCode EGL return dispatch_eglGetProcAddress0(procname, eglGetProcAddressHandle); +CustomJavaCode EGL return dispatch_eglGetProcAddress1(procname, eglGetProcAddressHandle); CustomJavaCode EGL } -Import com.sun.gluegen.runtime.opengl.GLProcAddressHelper +Import com.jogamp.gluegen.runtime.opengl.GLProcAddressHelper diff --git a/make/config/jogl/eglext.cfg b/make/config/jogl/eglext.cfg index fedff35e9..40239371d 100755 --- 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.sun.opengl.impl.egl +Package com.jogamp.opengl.impl.egl Style InterfaceAndImpl JavaClass EGLExt -ImplPackage com.sun.opengl.impl.egl +ImplPackage com.jogamp.opengl.impl.egl ImplJavaClass EGLExtImpl # Shouldn't matter which one of these we pick up Include egl-common.cfg -ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/com/sun/opengl/impl/egl/EGL.java +ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/com/jogamp/opengl/impl/egl/EGL.java HierarchicalNativeOutput false diff --git a/make/config/jogl/gl-common.cfg b/make/config/jogl/gl-common.cfg index d9d66323a..8d726c4bf 100644 --- a/make/config/jogl/gl-common.cfg +++ b/make/config/jogl/gl-common.cfg @@ -8,11 +8,10 @@ RuntimeExceptionType GLException UnsupportedExceptionType GLException # Imports needed by all glue code -Import java.nio.* Import java.util.* Import javax.media.opengl.* Import javax.media.opengl.fixedfunc.* -Import com.sun.opengl.impl.* +Import com.jogamp.opengl.impl.* ##################################################################### # Mostly desktop OpenGL stuff below @@ -389,8 +388,12 @@ ArgumentIsString glTransformFeedbackVaryings 2 # Use cached GL_EXTENSION if possible, # which also allows GL3 compatibility. # -JavaPrologue glGetString if(GL.GL_EXTENSIONS==name && _context.isExtensionCacheInitialized()) { -JavaPrologue glGetString return _context.getGLExtensions(); +JavaPrologue glGetString if(_context.isExtensionCacheInitialized()) { +JavaPrologue glGetString if(GL.GL_EXTENSIONS==name) { +JavaPrologue glGetString return _context.getGLExtensions(); +JavaPrologue glGetString } /* else if(GL.GL_VERSION==name) { +JavaPrologue glGetString return _context.getGLVersion(); +JavaPrologue glGetString } */ JavaPrologue glGetString } # diff --git a/make/config/jogl/gl-desktop.cfg b/make/config/jogl/gl-desktop.cfg index 7e500a4f0..f35ed254b 100755 --- a/make/config/jogl/gl-desktop.cfg +++ b/make/config/jogl/gl-desktop.cfg @@ -65,6 +65,6 @@ TemporaryCVariableDeclaration glXChooseFBConfigSGIX int count; TemporaryCVariableAssignment glXChooseFBConfigSGIX count = _ptr3[0]; ReturnValueCapacity glXChooseFBConfigSGIX count * sizeof(GLXFBConfig) TemporaryCVariableDeclaration glXGetFBConfigs int count; -TemporaryCVariableAssignment glXGetFBConfigs count = _ptr2[0]; +TemporaryCVariableAssignment glXGetFBConfigs count = _nelements_ptr[0]; ReturnValueCapacity glXGetFBConfigs count * sizeof(GLXFBConfig) diff --git a/make/config/jogl/gl-es1.cfg b/make/config/jogl/gl-es1.cfg index 867ef8a83..da2267186 100755 --- 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.sun.opengl.impl.es1 +ImplPackage com.jogamp.opengl.impl.es1 ImplJavaClass GLES1Impl Implements GLES1Impl GLBase Implements GLES1Impl GL @@ -97,4 +97,4 @@ IncludeAs CustomCCode gl-impl-CustomCCode-gles1.c Import javax.media.opengl.GLES1 Import javax.media.opengl.GLES2 Import javax.media.opengl.GL2 -Import com.sun.opengl.impl.InternalBufferUtil +Import com.jogamp.opengl.impl.InternalBufferUtil diff --git a/make/config/jogl/gl-es2.cfg b/make/config/jogl/gl-es2.cfg index f78001dee..fd11ffcf0 100755 --- 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.sun.opengl.impl.es2 +ImplPackage com.jogamp.opengl.impl.es2 ImplJavaClass GLES2Impl Implements GLES2Impl GLBase Implements GLES2Impl GL @@ -79,6 +79,6 @@ Import javax.media.opengl.GLES2 Import javax.media.opengl.GL2 Import javax.media.opengl.GLArrayData Import javax.media.opengl.GLUniformData -Import com.sun.opengl.impl.InternalBufferUtil +Import com.jogamp.opengl.impl.InternalBufferUtil Import java.io.PrintStream diff --git a/make/config/jogl/gl-gl2.cfg b/make/config/jogl/gl-gl2.cfg index 820243ff5..48dd8eda6 100644 --- a/make/config/jogl/gl-gl2.cfg +++ b/make/config/jogl/gl-gl2.cfg @@ -12,72 +12,32 @@ ExtendedInterfaceSymbolsIgnore ../src/jogl/classes/javax/media/opengl/fixedfunc/ ExtendedInterfaceSymbolsIgnore ../src/jogl/classes/javax/media/opengl/fixedfunc/GLLightingFunc.java Package javax.media.opengl -Style InterfaceAndImpl +Style InterfaceOnly JavaClass GL2 Extends GL2 GLBase Extends GL2 GL Extends GL2 GL2ES1 Extends GL2 GL2ES2 Extends GL2 GL2GL3 -ImplPackage com.sun.opengl.impl.gl2 -ImplJavaClass GL2Impl -Implements GL2Impl GLBase -Implements GL2Impl GL -Implements GL2Impl GL2ES1 -Implements GL2Impl GL2ES2 -Implements GL2Impl GL2GL3 Include gl-common.cfg Include gl-common-extensions.cfg Include gl-desktop.cfg -EmitProcAddressTable true -ProcAddressTableClassName GL2ProcAddressTable -GetProcAddressTableExpr ((GL2ProcAddressTable)_context.getGLProcAddressTable()) - # Pick up on-line OpenGL javadoc thanks to user cylab on javagaming.org forums TagNativeBinding true # Ignore extensions that are already picked up via the GL2ES1 interface IgnoreExtension GL_EXT_point_parameters -# Add PixelStorei StateTracker -# -CustomJavaCode GL2Impl private static final int params_offset = 0; // just a helper for JavaPrologue .. - -JavaPrologue glPixelStorei glStateTracker.setInt(pname, param); - -JavaPrologue glGetIntegerv if ( glStateTracker.getInt(pname, params, params_offset) ) { return; } - CustomJavaCode GL2 public boolean glIsPBOPackEnabled(); CustomJavaCode GL2 public boolean glIsPBOUnpackEnabled(); IncludeAs CustomJavaCode GL2 gl-if-CustomJavaCode-gl2.java -CustomJavaCode GL2Impl public void glFrustumf(float left, float right, float bottom, float top, float zNear, float zFar) { -CustomJavaCode GL2Impl glFrustum((double)left, (double)right, (double)bottom, (double)top, (double)zNear, (double)zFar); } - -CustomJavaCode GL2Impl public void glOrthof(float left, float right, float bottom, float top, float zNear, float zFar) { -CustomJavaCode GL2Impl glOrtho((double)left, (double)right, (double)bottom, (double)top, (double)zNear, (double)zFar); } - -CustomJavaCode GL2Impl public void glClearDepthf(float depth) { -CustomJavaCode GL2Impl glClearDepth((double)depth); } - -CustomJavaCode GL2Impl public void glDepthRangef(float zNear, float zFar) { -CustomJavaCode GL2Impl glDepthRange((double)zNear, (double)zFar); } - Include gl-headers.cfg Include ../intptr.cfg -IncludeAs CustomJavaCode GL2Impl gl-impl-CustomJavaCode-common.java -IncludeAs CustomJavaCode GL2Impl gl-impl-CustomJavaCode-gl2.java -IncludeAs CustomJavaCode GL2Impl gl-impl-CustomJavaCode-desktop.java -IncludeAs CustomJavaCode GL2Impl gl-impl-CustomJavaCode-gl2_es2.java -IncludeAs CustomCCode gl-impl-CustomCCode-gl2.c +EmitProcAddressTable false +ProcAddressTableClassName DontGenerateProcAddressTableStuff +GetProcAddressTableExpr DontGenerateProcAddressTableStuff -Import javax.media.opengl.GLES1 -Import javax.media.opengl.GLES2 -Import javax.media.opengl.GL2 -Import javax.media.opengl.GLArrayData -Import javax.media.opengl.GLUniformData -Import com.sun.opengl.impl.InternalBufferUtil -Import java.io.PrintStream diff --git a/make/config/jogl/gl-gl2es12.cfg b/make/config/jogl/gl-gl2es12.cfg index 232116a61..3942b1419 100644 --- a/make/config/jogl/gl-gl2es12.cfg +++ b/make/config/jogl/gl-gl2es12.cfg @@ -11,7 +11,7 @@ ExtendedInterfaceSymbolsOnly ../src/jogl/classes/javax/media/opengl/fixedfunc/GL ExtendedInterfaceSymbolsOnly ../src/jogl/classes/javax/media/opengl/fixedfunc/GLLightingFunc.java Style ImplOnly -ImplPackage com.sun.opengl.impl.gl2es12 +ImplPackage com.jogamp.opengl.impl.gl2es12 ImplJavaClass GL2ES12Impl Implements GL2ES12Impl GLBase Implements GL2ES12Impl GL @@ -86,5 +86,5 @@ IncludeAs CustomCCode gl-impl-CustomCCode-gl2es12.c Import javax.media.opengl.GLES1 Import javax.media.opengl.GLES2 -Import com.sun.opengl.impl.InternalBufferUtil +Import com.jogamp.opengl.impl.InternalBufferUtil Import java.io.PrintStream diff --git a/make/config/jogl/gl-gl3.cfg b/make/config/jogl/gl-gl3.cfg index 9f0ea05a8..d5e0003d4 100644 --- a/make/config/jogl/gl-gl3.cfg +++ b/make/config/jogl/gl-gl3.cfg @@ -8,13 +8,13 @@ ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/javax/media/opengl/G ExtendedInterfaceSymbolsIgnore ../src/jogl/classes/javax/media/opengl/GLBase.java Package javax.media.opengl -Style InterfaceAndImpl +Style InterfaceOnly JavaClass GL3 Extends GL3 GLBase Extends GL3 GL Extends GL3 GL2ES2 Extends GL3 GL2GL3 -ImplPackage com.sun.opengl.impl.gl3 +ImplPackage com.jogamp.opengl.impl.gl3 ImplJavaClass GL3Impl Implements GL3Impl GLBase Implements GL3Impl GL @@ -27,48 +27,15 @@ Include gl3-desktop.cfg IncludeAs CustomJavaCode GL3 gl-if-CustomJavaCode-gl3.java -EmitProcAddressTable true -ProcAddressTableClassName GL3ProcAddressTable -GetProcAddressTableExpr ((GL3ProcAddressTable)_context.getGLProcAddressTable()) - -# Force all of the methods to be emitted using dynamic linking so we -# don't need to link against any emulation library on the desktop or -# depend on the presence of an import library for a particular device -ForceProcAddressGen __ALL__ - -# Also force the calling conventions of the locally generated function -# pointer typedefs for these routines to APIENTRY -LocalProcAddressCallingConvention __ALL__ APIENTRY +EmitProcAddressTable false # Pick up on-line OpenGL javadoc thanks to user cylab on javagaming.org forums TagNativeBinding true -# Add PixelStorei StateTracker -# -CustomJavaCode GL3Impl private static final int params_offset = 0; // just a helper for JavaPrologue .. - -JavaPrologue glPixelStorei glStateTracker.setInt(pname, param); - -JavaPrologue glGetIntegerv if ( glStateTracker.getInt(pname, params, params_offset) ) { return; } - -CustomJavaCode GL3Impl public void glClearDepthf(float depth) { -CustomJavaCode GL3Impl glClearDepth((double)depth); } - -CustomJavaCode GL3Impl public void glDepthRangef(float zNear, float zFar) { -CustomJavaCode GL3Impl glDepthRange((double)zNear, (double)zFar); } - Include gl3-headers.cfg Include ../intptr.cfg -IncludeAs CustomJavaCode GL3Impl gl-impl-CustomJavaCode-common.java -IncludeAs CustomJavaCode GL3Impl gl-impl-CustomJavaCode-gl3.java -IncludeAs CustomJavaCode GL3Impl gl-impl-CustomJavaCode-desktop.java -IncludeAs CustomJavaCode GL3Impl gl-impl-CustomJavaCode-gl2_es2.java -IncludeAs CustomCCode gl-impl-CustomCCode-gl3.c +EmitProcAddressTable false +ProcAddressTableClassName DontGenerateProcAddressTableStuff +GetProcAddressTableExpr DontGenerateProcAddressTableStuff -Import javax.media.opengl.GLES2 -Import javax.media.opengl.GL3 -Import javax.media.opengl.GLArrayData -Import javax.media.opengl.GLUniformData -Import com.sun.opengl.impl.InternalBufferUtil -Import java.io.PrintStream diff --git a/make/config/jogl/gl-gl3bc.cfg b/make/config/jogl/gl-gl3bc.cfg index d2525735e..7c53ea8d6 100644 --- a/make/config/jogl/gl-gl3bc.cfg +++ b/make/config/jogl/gl-gl3bc.cfg @@ -14,7 +14,7 @@ ExtendedInterfaceSymbolsIgnore ../src/jogl/classes/javax/media/opengl/fixedfunc/ ExtendedInterfaceSymbolsIgnore ../src/jogl/classes/javax/media/opengl/fixedfunc/GLLightingFunc.java Package javax.media.opengl -Style InterfaceAndImpl +Style InterfaceOnly JavaClass GL3bc Extends GL3bc GLBase Extends GL3bc GL @@ -23,15 +23,6 @@ Extends GL3bc GL2ES2 Extends GL3bc GL2GL3 Extends GL3bc GL2 Extends GL3bc GL3 -ImplPackage com.sun.opengl.impl.gl3 -ImplJavaClass GL3bcImpl -Implements GL3bcImpl GLBase -Implements GL3bcImpl GL -Implements GL3bcImpl GL2ES1 -Implements GL3bcImpl GL2ES2 -Implements GL3bcImpl GL2GL3 -Implements GL3bcImpl GL2 -Implements GL3bcImpl GL3 Include gl-common.cfg Include gl-common-extensions.cfg @@ -39,63 +30,17 @@ Include gl-desktop.cfg Include gl3-common.cfg Include gl3-desktop.cfg -# Because we're manually implementing glMapBuffer but only producing -# the implementing class, GlueGen doesn't notice that it has to emit a -# proc address table entry for it. Force it to here. -ForceProcAddressGen glMapBuffer - -# Force all of the methods to be emitted using dynamic linking so we -# don't need to link against any emulation library on the desktop or -# depend on the presence of an import library for a particular device -ForceProcAddressGen __ALL__ - -# Also force the calling conventions of the locally generated function -# pointer typedefs for these routines to APIENTRY -LocalProcAddressCallingConvention __ALL__ APIENTRY - -EmitProcAddressTable true -ProcAddressTableClassName GL3bcProcAddressTable -GetProcAddressTableExpr ((GL3bcProcAddressTable)_context.getGLProcAddressTable()) - # Pick up on-line OpenGL javadoc thanks to user cylab on javagaming.org forums TagNativeBinding true # Ignore extensions that are already picked up via the GL2ES1 interface IgnoreExtension GL_EXT_point_parameters -# Add PixelStorei StateTracker -CustomJavaCode GL3bcImpl private static final int params_offset = 0; // just a helper for JavaPrologue .. - -JavaPrologue glPixelStorei glStateTracker.setInt(pname, param); - -JavaPrologue glGetIntegerv if ( glStateTracker.getInt(pname, params, params_offset) ) { return; } - -CustomJavaCode GL3bcImpl public void glFrustumf(float left, float right, float bottom, float top, float zNear, float zFar) { -CustomJavaCode GL3bcImpl glFrustum((double)left, (double)right, (double)bottom, (double)top, (double)zNear, (double)zFar); } - -CustomJavaCode GL3bcImpl public void glOrthof(float left, float right, float bottom, float top, float zNear, float zFar) { -CustomJavaCode GL3bcImpl glOrtho((double)left, (double)right, (double)bottom, (double)top, (double)zNear, (double)zFar); } - -CustomJavaCode GL3bcImpl public void glClearDepthf(float depth) { -CustomJavaCode GL3bcImpl glClearDepth((double)depth); } - -CustomJavaCode GL3bcImpl public void glDepthRangef(float zNear, float zFar) { -CustomJavaCode GL3bcImpl glDepthRange((double)zNear, (double)zFar); } - Include gl-headers.cfg +Include gl3ext-headers.cfg Include ../intptr.cfg -IncludeAs CustomJavaCode GL3bcImpl gl-impl-CustomJavaCode-common.java -IncludeAs CustomJavaCode GL3bcImpl gl-impl-CustomJavaCode-gl3bc.java -IncludeAs CustomJavaCode GL3bcImpl gl-impl-CustomJavaCode-desktop.java -IncludeAs CustomJavaCode GL3bcImpl gl-impl-CustomJavaCode-gl2_es2.java -IncludeAs CustomCCode gl-impl-CustomCCode-gl3bc.c +EmitProcAddressTable false +ProcAddressTableClassName DontGenerateProcAddressTableStuff +GetProcAddressTableExpr DontGenerateProcAddressTableStuff -Import javax.media.opengl.GLES1 -Import javax.media.opengl.GLES2 -Import javax.media.opengl.GL2GL3 -Import javax.media.opengl.GL2 -Import javax.media.opengl.GL3 -Import javax.media.opengl.GL3bc -Import com.sun.opengl.impl.InternalBufferUtil -Import java.io.PrintStream diff --git a/make/config/jogl/gl-gl4.cfg b/make/config/jogl/gl-gl4.cfg new file mode 100644 index 000000000..1d4392899 --- /dev/null +++ b/make/config/jogl/gl-gl4.cfg @@ -0,0 +1,37 @@ +# This .cfg file is used to generate the GL interface and implementing class. +JavaOutputDir gensrc/classes +NativeOutputDir gensrc/native/jogl/gl4 + +ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/javax/media/opengl/GL.java +ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/javax/media/opengl/GL2ES2.java +ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/javax/media/opengl/GL2GL3.java +ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/javax/media/opengl/GL3.java +ExtendedInterfaceSymbolsIgnore ../src/jogl/classes/javax/media/opengl/GLBase.java + +Package javax.media.opengl +Style InterfaceOnly +JavaClass GL4 +Extends GL4 GLBase +Extends GL4 GL +Extends GL4 GL2ES2 +Extends GL4 GL2GL3 +Extends GL4 GL3 +Include gl-common.cfg +Include gl-common-extensions.cfg +Include gl3-common.cfg +Include gl4-common.cfg +Include gl3-desktop.cfg + +IncludeAs CustomJavaCode GL4 gl-if-CustomJavaCode-gl3.java + +EmitProcAddressTable false +ProcAddressTableClassName DontGenerateProcAddressTableStuff +GetProcAddressTableExpr DontGenerateProcAddressTableStuff + + +# Pick up on-line OpenGL javadoc thanks to user cylab on javagaming.org forums +TagNativeBinding true + +Include gl3-headers.cfg +Include ../intptr.cfg + diff --git a/make/config/jogl/gl-gl4bc.cfg b/make/config/jogl/gl-gl4bc.cfg new file mode 100644 index 000000000..3a3e02041 --- /dev/null +++ b/make/config/jogl/gl-gl4bc.cfg @@ -0,0 +1,110 @@ +# This .cfg file is used to generate the GL interface and implementing class. +JavaOutputDir gensrc/classes +NativeOutputDir gensrc/native/jogl/gl4 + +ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/javax/media/opengl/GL.java +ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/javax/media/opengl/GL2ES1.java +ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/javax/media/opengl/GL2ES2.java +ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/javax/media/opengl/GL2GL3.java +ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/javax/media/opengl/GL2.java +ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/javax/media/opengl/GL3.java +ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/javax/media/opengl/GL4.java +ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/javax/media/opengl/GL3bc.java +ExtendedInterfaceSymbolsIgnore ../src/jogl/classes/javax/media/opengl/GLBase.java +ExtendedInterfaceSymbolsIgnore ../src/jogl/classes/javax/media/opengl/fixedfunc/GLMatrixFunc.java +ExtendedInterfaceSymbolsIgnore ../src/jogl/classes/javax/media/opengl/fixedfunc/GLPointerFunc.java +ExtendedInterfaceSymbolsIgnore ../src/jogl/classes/javax/media/opengl/fixedfunc/GLLightingFunc.java + +Package javax.media.opengl +Style InterfaceAndImpl +JavaClass GL4bc +Extends GL4bc GLBase +Extends GL4bc GL +Extends GL4bc GL2ES1 +Extends GL4bc GL2ES2 +Extends GL4bc GL2GL3 +Extends GL4bc GL2 +Extends GL4bc GL3 +Extends GL4bc GL3bc +Extends GL4bc GL4 +ImplPackage com.jogamp.opengl.impl.gl4 +ImplJavaClass GL4bcImpl +Implements GL4bcImpl GLBase +Implements GL4bcImpl GL +Implements GL4bcImpl GL2ES1 +Implements GL4bcImpl GL2ES2 +Implements GL4bcImpl GL2GL3 +Implements GL4bcImpl GL2 +Implements GL4bcImpl GL3 +Implements GL4bcImpl GL3bc +Implements GL4bcImpl GL4 + +Include gl-common.cfg +Include gl-common-extensions.cfg +Include gl-desktop.cfg +Include gl3-common.cfg +Include gl4-common.cfg +Include gl3-desktop.cfg + +# Because we're manually implementing glMapBuffer but only producing +# the implementing class, GlueGen doesn't notice that it has to emit a +# proc address table entry for it. Force it to here. +ForceProcAddressGen glMapBuffer + +# Force all of the methods to be emitted using dynamic linking so we +# don't need to link against any emulation library on the desktop or +# depend on the presence of an import library for a particular device +ForceProcAddressGen __ALL__ + +# Also force the calling conventions of the locally generated function +# pointer typedefs for these routines to APIENTRY +LocalProcAddressCallingConvention __ALL__ APIENTRY + +EmitProcAddressTable true +ProcAddressTableClassName GL4bcProcAddressTable +GetProcAddressTableExpr ((GL4bcProcAddressTable)_context.getGLProcAddressTable()) + +# Pick up on-line OpenGL javadoc thanks to user cylab on javagaming.org forums +TagNativeBinding true + +# Ignore extensions that are already picked up via the GL2ES1 interface +IgnoreExtension GL_EXT_point_parameters + +# Add PixelStorei StateTracker +CustomJavaCode GL4bcImpl private static final int params_offset = 0; // just a helper for JavaPrologue .. + +JavaPrologue glPixelStorei glStateTracker.setInt(pname, param); + +JavaPrologue glGetIntegerv if ( glStateTracker.getInt(pname, params, params_offset) ) { return; } + +CustomJavaCode GL4bcImpl public void glFrustumf(float left, float right, float bottom, float top, float zNear, float zFar) { +CustomJavaCode GL4bcImpl glFrustum((double)left, (double)right, (double)bottom, (double)top, (double)zNear, (double)zFar); } + +CustomJavaCode GL4bcImpl public void glOrthof(float left, float right, float bottom, float top, float zNear, float zFar) { +CustomJavaCode GL4bcImpl glOrtho((double)left, (double)right, (double)bottom, (double)top, (double)zNear, (double)zFar); } + +CustomJavaCode GL4bcImpl public void glClearDepthf(float depth) { +CustomJavaCode GL4bcImpl glClearDepth((double)depth); } + +CustomJavaCode GL4bcImpl public void glDepthRangef(float zNear, float zFar) { +CustomJavaCode GL4bcImpl glDepthRange((double)zNear, (double)zFar); } + +Include gl-headers.cfg +Include gl3ext-headers.cfg +Include ../intptr.cfg + +IncludeAs CustomJavaCode GL4bcImpl gl-impl-CustomJavaCode-common.java +IncludeAs CustomJavaCode GL4bcImpl gl-impl-CustomJavaCode-gl4bc.java +IncludeAs CustomJavaCode GL4bcImpl gl-impl-CustomJavaCode-desktop.java +IncludeAs CustomJavaCode GL4bcImpl gl-impl-CustomJavaCode-gl2_es2.java +IncludeAs CustomCCode gl-impl-CustomCCode-gl4bc.c + +Import javax.media.opengl.GLES1 +Import javax.media.opengl.GLES2 +Import javax.media.opengl.GL2GL3 +Import javax.media.opengl.GL2 +Import javax.media.opengl.GL3 +Import javax.media.opengl.GL3bc +Import javax.media.opengl.GL4 +Import com.jogamp.opengl.impl.InternalBufferUtil +Import java.io.PrintStream diff --git a/make/config/jogl/gl-impl-CustomCCode-gl2es12.c b/make/config/jogl/gl-impl-CustomCCode-gl2es12.c index e2d5cb58d..07b821802 100644 --- a/make/config/jogl/gl-impl-CustomCCode-gl2es12.c +++ b/make/config/jogl/gl-impl-CustomCCode-gl2es12.c @@ -1,10 +1,10 @@ /* Java->C glue code: - * Java package: com.sun.opengl.impl.gl2es12.GL2ES12Impl + * Java package: com.jogamp.opengl.impl.gl2es12.GL2ES12Impl * Java method: long dispatch_glMapBuffer(int target, int access) * C function: void * glMapBuffer(GLenum target, GLenum access); */ JNIEXPORT jlong JNICALL -Java_com_sun_opengl_impl_gl2es12_GL2ES12Impl_dispatch_1glMapBuffer(JNIEnv *env, jobject _unused, jint target, jint access, jlong glProcAddress) { +Java_com_jogamp_opengl_impl_gl2es12_GL2ES12Impl_dispatch_1glMapBuffer(JNIEnv *env, jobject _unused, jint target, jint access, jlong glProcAddress) { PFNGLMAPBUFFERPROC ptr_glMapBuffer; void * _res; ptr_glMapBuffer = (PFNGLMAPBUFFERPROC) (intptr_t) glProcAddress; @@ -14,11 +14,11 @@ Java_com_sun_opengl_impl_gl2es12_GL2ES12Impl_dispatch_1glMapBuffer(JNIEnv *env, } /* Java->C glue code: - * Java package: com.sun.opengl.impl.gl2es12.GL2ES12Impl + * Java package: com.jogamp.opengl.impl.gl2es12.GL2ES12Impl * Java method: ByteBuffer newDirectByteBuffer(long addr, int capacity); * C function: jobject newDirectByteBuffer(jlong addr, jint capacity); */ JNIEXPORT jobject JNICALL -Java_com_sun_opengl_impl_gl2es12_GL2ES12Impl_newDirectByteBuffer(JNIEnv *env, jobject _unused, jlong addr, jint capacity) { +Java_com_jogamp_opengl_impl_gl2es12_GL2ES12Impl_newDirectByteBuffer(JNIEnv *env, jobject _unused, jlong addr, jint capacity) { return (*env)->NewDirectByteBuffer(env, (void*) (intptr_t) addr, capacity); } diff --git a/make/config/jogl/gl-impl-CustomCCode-gl3.c b/make/config/jogl/gl-impl-CustomCCode-gl3.c deleted file mode 100644 index a5f78a460..000000000 --- a/make/config/jogl/gl-impl-CustomCCode-gl3.c +++ /dev/null @@ -1,24 +0,0 @@ -/* Java->C glue code: - * Java package: com.sun.opengl.impl.gl3.GL3Impl - * Java method: long dispatch_glMapBuffer(int target, int access) - * C function: void * glMapBuffer(GLenum target, GLenum access); - */ -JNIEXPORT jlong JNICALL -Java_com_sun_opengl_impl_gl3_GL3Impl_dispatch_1glMapBuffer(JNIEnv *env, jobject _unused, jint target, jint access, jlong glProcAddress) { - PFNGLMAPBUFFERPROC ptr_glMapBuffer; - void * _res; - ptr_glMapBuffer = (PFNGLMAPBUFFERPROC) (intptr_t) glProcAddress; - assert(ptr_glMapBuffer != NULL); - _res = (* ptr_glMapBuffer) ((GLenum) target, (GLenum) access); - return (jlong) (intptr_t) _res; -} - -/* Java->C glue code: - * Java package: com.sun.opengl.impl.gl3.GL3Impl - * Java method: ByteBuffer newDirectByteBuffer(long addr, int capacity); - * C function: jobject newDirectByteBuffer(jlong addr, jint capacity); - */ -JNIEXPORT jobject JNICALL -Java_com_sun_opengl_impl_gl3_GL3Impl_newDirectByteBuffer(JNIEnv *env, jobject _unused, jlong addr, jint capacity) { - return (*env)->NewDirectByteBuffer(env, (void*) (intptr_t) addr, capacity); -} diff --git a/make/config/jogl/gl-impl-CustomCCode-gl3bc.c b/make/config/jogl/gl-impl-CustomCCode-gl3bc.c deleted file mode 100644 index a69204198..000000000 --- a/make/config/jogl/gl-impl-CustomCCode-gl3bc.c +++ /dev/null @@ -1,24 +0,0 @@ -/* Java->C glue code: - * Java package: com.sun.opengl.impl.gl3.GL3bcImpl - * Java method: long dispatch_glMapBuffer(int target, int access) - * C function: void * glMapBuffer(GLenum target, GLenum access); - */ -JNIEXPORT jlong JNICALL -Java_com_sun_opengl_impl_gl3_GL3bcImpl_dispatch_1glMapBuffer(JNIEnv *env, jobject _unused, jint target, jint access, jlong glProcAddress) { - PFNGLMAPBUFFERPROC ptr_glMapBuffer; - void * _res; - ptr_glMapBuffer = (PFNGLMAPBUFFERPROC) (intptr_t) glProcAddress; - assert(ptr_glMapBuffer != NULL); - _res = (* ptr_glMapBuffer) ((GLenum) target, (GLenum) access); - return (jlong) (intptr_t) _res; -} - -/* Java->C glue code: - * Java package: com.sun.opengl.impl.gl3.GL3bcImpl - * Java method: ByteBuffer newDirectByteBuffer(long addr, int capacity); - * C function: jobject newDirectByteBuffer(jlong addr, jint capacity); - */ -JNIEXPORT jobject JNICALL -Java_com_sun_opengl_impl_gl3_GL3bcImpl_newDirectByteBuffer(JNIEnv *env, jobject _unused, jlong addr, jint capacity) { - return (*env)->NewDirectByteBuffer(env, (void*) (intptr_t) addr, capacity); -} diff --git a/make/config/jogl/gl-impl-CustomCCode-gl2.c b/make/config/jogl/gl-impl-CustomCCode-gl4bc.c index f97b8eaff..bcda20fa4 100644 --- a/make/config/jogl/gl-impl-CustomCCode-gl2.c +++ b/make/config/jogl/gl-impl-CustomCCode-gl4bc.c @@ -1,10 +1,10 @@ /* Java->C glue code: - * Java package: com.sun.opengl.impl.gl2.GL2Impl + * Java package: com.jogamp.opengl.impl.gl4.GL4bcImpl * Java method: long dispatch_glMapBuffer(int target, int access) * C function: void * glMapBuffer(GLenum target, GLenum access); */ JNIEXPORT jlong JNICALL -Java_com_sun_opengl_impl_gl2_GL2Impl_dispatch_1glMapBuffer(JNIEnv *env, jobject _unused, jint target, jint access, jlong glProcAddress) { +Java_com_jogamp_opengl_impl_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,11 +14,11 @@ Java_com_sun_opengl_impl_gl2_GL2Impl_dispatch_1glMapBuffer(JNIEnv *env, jobject } /* Java->C glue code: - * Java package: com.sun.opengl.impl.gl2.GL2Impl + * Java package: com.jogamp.opengl.impl.gl4.GL4bcImpl * Java method: ByteBuffer newDirectByteBuffer(long addr, int capacity); * C function: jobject newDirectByteBuffer(jlong addr, jint capacity); */ JNIEXPORT jobject JNICALL -Java_com_sun_opengl_impl_gl2_GL2Impl_newDirectByteBuffer(JNIEnv *env, jobject _unused, jlong addr, jint capacity) { +Java_com_jogamp_opengl_impl_gl4_GL4bcImpl_newDirectByteBuffer(JNIEnv *env, jobject _unused, jlong addr, jint 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 efc614e64..a71ca4aae 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.sun.opengl.impl.es1.GLES1Impl + * Java package: com.jogamp.opengl.impl.es1.GLES1Impl * Java method: long dispatch_glMapBuffer(int target, int access) * C function: void * glMapBuffer(GLenum target, GLenum access); */ JNIEXPORT jlong JNICALL -Java_com_sun_opengl_impl_es1_GLES1Impl_dispatch_1glMapBuffer(JNIEnv *env, jobject _unused, jint target, jint access, jlong glProcAddress) { +Java_com_jogamp_opengl_impl_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_sun_opengl_impl_es1_GLES1Impl_dispatch_1glMapBuffer(JNIEnv *env, jobjec } /* Java->C glue code: - * Java package: com.sun.opengl.impl.es1.GLES1Impl + * Java package: com.jogamp.opengl.impl.es1.GLES1Impl * Java method: ByteBuffer newDirectByteBuffer(long addr, int capacity); * C function: jobject newDirectByteBuffer(jlong addr, jint capacity); */ JNIEXPORT jobject JNICALL -Java_com_sun_opengl_impl_es1_GLES1Impl_newDirectByteBuffer(JNIEnv *env, jobject _unused, jlong addr, jint capacity) { +Java_com_jogamp_opengl_impl_es1_GLES1Impl_newDirectByteBuffer(JNIEnv *env, jobject _unused, jlong addr, jint 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 27be04749..f99822d65 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.sun.opengl.impl.es2.GLES2Impl + * Java package: com.jogamp.opengl.impl.es2.GLES2Impl * Java method: long dispatch_glMapBuffer(int target, int access) * C function: void * glMapBuffer(GLenum target, GLenum access); */ JNIEXPORT jlong JNICALL -Java_com_sun_opengl_impl_es2_GLES2Impl_dispatch_1glMapBuffer(JNIEnv *env, jobject _unused, jint target, jint access, jlong glProcAddress) { +Java_com_jogamp_opengl_impl_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_sun_opengl_impl_es2_GLES2Impl_dispatch_1glMapBuffer(JNIEnv *env, jobjec } /* Java->C glue code: - * Java package: com.sun.opengl.impl.es2.GLES2Impl + * Java package: com.jogamp.opengl.impl.es2.GLES2Impl * Java method: ByteBuffer newDirectByteBuffer(long addr, int capacity); * C function: jobject newDirectByteBuffer(jlong addr, jint capacity); */ JNIEXPORT jobject JNICALL -Java_com_sun_opengl_impl_es2_GLES2Impl_newDirectByteBuffer(JNIEnv *env, jobject _unused, jlong addr, jint capacity) { +Java_com_jogamp_opengl_impl_es2_GLES2Impl_newDirectByteBuffer(JNIEnv *env, jobject _unused, jlong addr, jint capacity) { return (*env)->NewDirectByteBuffer(env, (void*) (intptr_t) addr, capacity); } diff --git a/make/config/jogl/gl-impl-CustomJavaCode-common.java b/make/config/jogl/gl-impl-CustomJavaCode-common.java index 564606799..4872490b0 100644 --- a/make/config/jogl/gl-impl-CustomJavaCode-common.java +++ b/make/config/jogl/gl-impl-CustomJavaCode-common.java @@ -1,16 +1,58 @@ - public GLProfile getGLProfile() { - return this.glProfile; - } - private GLProfile glProfile; - - public int glGetBoundBuffer(int target) { - return bufferStateTracker.getBoundBufferObject(target, this); - } - - public boolean glIsVBOArrayEnabled() { - return checkArrayVBOEnabled(false); - } - - public boolean glIsVBOElementEnabled() { - return checkElementVBOEnabled(false); - } + public GLProfile getGLProfile() { + return this.glProfile; + } + private GLProfile glProfile; + + public int glGetBoundBuffer(int target) { + return bufferStateTracker.getBoundBufferObject(target, this); + } + + public boolean glIsVBOArrayEnabled() { + return checkArrayVBOEnabled(false); + } + + public boolean glIsVBOElementEnabled() { + return checkElementVBOEnabled(false); + } + + public final boolean isGL() { + return true; + } + + public final GL getGL() throws GLException { + return this; + } + + public boolean isFunctionAvailable(String glFunctionName) { + return _context.isFunctionAvailable(glFunctionName); + } + + public boolean isExtensionAvailable(String glExtensionName) { + return _context.isExtensionAvailable(glExtensionName); + } + + public Object getExtension(String extensionName) { + // At this point we don't expose any extensions using this mechanism + return null; + } + + /** Returns the context this GL object is associated with for better + error checking by DebugGL. */ + public GLContext getContext() { + return _context; + } + + private GLContextImpl _context; + + public void setSwapInterval(int interval) { + _context.setSwapInterval(interval); + } + + public int getSwapInterval() { + return _context.getSwapInterval(); + } + + public Object getPlatformGLExtensions() { + return _context.getPlatformGLExtensions(); + } + diff --git a/make/config/jogl/gl-impl-CustomJavaCode-desktop.java b/make/config/jogl/gl-impl-CustomJavaCode-desktop.java index 04ba39c3d..93a275269 100644 --- a/make/config/jogl/gl-impl-CustomJavaCode-desktop.java +++ b/make/config/jogl/gl-impl-CustomJavaCode-desktop.java @@ -1,79 +1,191 @@ -private int[] imageSizeTemp = new int[1]; - -/** Helper for more precise computation of number of bytes that will - be touched by a pixel pack or unpack operation. */ -private int imageSizeInBytes(int bytesPerElement, - int width, int height, int depth, boolean pack) { - int rowLength = 0; - int skipRows = 0; - int skipPixels = 0; - int alignment = 1; - int imageHeight = 0; - int skipImages = 0; - - if (pack) { - glGetIntegerv(GL_PACK_ROW_LENGTH, imageSizeTemp, 0); - rowLength = imageSizeTemp[0]; - glGetIntegerv(GL_PACK_SKIP_ROWS, imageSizeTemp, 0); - skipRows = imageSizeTemp[0]; - glGetIntegerv(GL_PACK_SKIP_PIXELS, imageSizeTemp, 0); - skipPixels = imageSizeTemp[0]; - glGetIntegerv(GL_PACK_ALIGNMENT, imageSizeTemp, 0); - alignment = imageSizeTemp[0]; - if (depth > 1) { - glGetIntegerv(GL_PACK_IMAGE_HEIGHT, imageSizeTemp, 0); - imageHeight = imageSizeTemp[0]; - glGetIntegerv(GL_PACK_SKIP_IMAGES, imageSizeTemp, 0); - skipImages = imageSizeTemp[0]; + private int[] imageSizeTemp = new int[1]; + + /** Helper for more precise computation of number of bytes that will + be touched by a pixel pack or unpack operation. */ + private int imageSizeInBytes(int bytesPerElement, + int width, int height, int depth, boolean pack) { + int rowLength = 0; + int skipRows = 0; + int skipPixels = 0; + int alignment = 1; + int imageHeight = 0; + int skipImages = 0; + + if (pack) { + glGetIntegerv(GL_PACK_ROW_LENGTH, imageSizeTemp, 0); + rowLength = imageSizeTemp[0]; + glGetIntegerv(GL_PACK_SKIP_ROWS, imageSizeTemp, 0); + skipRows = imageSizeTemp[0]; + glGetIntegerv(GL_PACK_SKIP_PIXELS, imageSizeTemp, 0); + skipPixels = imageSizeTemp[0]; + glGetIntegerv(GL_PACK_ALIGNMENT, imageSizeTemp, 0); + alignment = imageSizeTemp[0]; + if (depth > 1) { + glGetIntegerv(GL_PACK_IMAGE_HEIGHT, imageSizeTemp, 0); + imageHeight = imageSizeTemp[0]; + glGetIntegerv(GL_PACK_SKIP_IMAGES, imageSizeTemp, 0); + skipImages = imageSizeTemp[0]; + } + } else { + glGetIntegerv(GL_UNPACK_ROW_LENGTH, imageSizeTemp, 0); + rowLength = imageSizeTemp[0]; + glGetIntegerv(GL_UNPACK_SKIP_ROWS, imageSizeTemp, 0); + skipRows = imageSizeTemp[0]; + glGetIntegerv(GL_UNPACK_SKIP_PIXELS, imageSizeTemp, 0); + skipPixels = imageSizeTemp[0]; + glGetIntegerv(GL_UNPACK_ALIGNMENT, imageSizeTemp, 0); + alignment = imageSizeTemp[0]; + if (depth > 1) { + glGetIntegerv(GL_UNPACK_IMAGE_HEIGHT, imageSizeTemp, 0); + imageHeight = imageSizeTemp[0]; + glGetIntegerv(GL_UNPACK_SKIP_IMAGES, imageSizeTemp, 0); + skipImages = imageSizeTemp[0]; + } } - } else { - glGetIntegerv(GL_UNPACK_ROW_LENGTH, imageSizeTemp, 0); - rowLength = imageSizeTemp[0]; - glGetIntegerv(GL_UNPACK_SKIP_ROWS, imageSizeTemp, 0); - skipRows = imageSizeTemp[0]; - glGetIntegerv(GL_UNPACK_SKIP_PIXELS, imageSizeTemp, 0); - skipPixels = imageSizeTemp[0]; - glGetIntegerv(GL_UNPACK_ALIGNMENT, imageSizeTemp, 0); - alignment = imageSizeTemp[0]; - if (depth > 1) { - glGetIntegerv(GL_UNPACK_IMAGE_HEIGHT, imageSizeTemp, 0); - imageHeight = imageSizeTemp[0]; - glGetIntegerv(GL_UNPACK_SKIP_IMAGES, imageSizeTemp, 0); - skipImages = imageSizeTemp[0]; + // Try to deal somewhat correctly with potentially invalid values + width = Math.max(0, width ); + height = Math.max(1, height); // min 1D + depth = Math.max(1, depth ); // min 1 * imageSize + skipRows = Math.max(0, skipRows); + skipPixels = Math.max(0, skipPixels); + alignment = Math.max(1, alignment); + skipImages = Math.max(0, skipImages); + + imageHeight = ( imageHeight > 0 ) ? imageHeight : height; + rowLength = ( rowLength > 0 ) ? rowLength : width; + + int rowLengthInBytes = rowLength * bytesPerElement; + + if (alignment > 1) { + int padding = rowLengthInBytes % alignment; + if (padding > 0) { + rowLengthInBytes += alignment - padding; + } } + + /** + * skipPixels and skipRows is a static one time offset. + * + * skipImages and depth are in multiples of image size. + * + * rowlenght is the actual repeating offset + * to go from line n to line n+1 at the same x-axis position. + */ + return + ( skipImages + depth - 1 ) * imageHeight * rowLengthInBytes + // whole images + ( skipRows + height - 1 ) * rowLengthInBytes + // lines with padding + ( skipPixels + width ) * bytesPerElement; // last line + } + + public final boolean isGL4bc() { + return _context.isGL4bc(); + } + + public final boolean isGL4() { + return _context.isGL4(); + } + + public final boolean isGL3bc() { + return _context.isGL3bc(); + } + + public final boolean isGL3() { + return _context.isGL3(); } - // Try to deal somewhat correctly with potentially invalid values - width = Math.max(0, width ); - height = Math.max(1, height); // min 1D - depth = Math.max(1, depth ); // min 1 * imageSize - skipRows = Math.max(0, skipRows); - skipPixels = Math.max(0, skipPixels); - alignment = Math.max(1, alignment); - skipImages = Math.max(0, skipImages); - imageHeight = ( imageHeight > 0 ) ? imageHeight : height; - rowLength = ( rowLength > 0 ) ? rowLength : width; + public final boolean isGL2() { + return _context.isGL2(); + } + + public final boolean isGL2ES1() { + return _context.isGL2ES1(); + } - int rowLengthInBytes = rowLength * bytesPerElement; + public final boolean isGL2ES2() { + return _context.isGL2ES2(); + } - if (alignment > 1) { - int padding = rowLengthInBytes % alignment; - if (padding > 0) { - rowLengthInBytes += alignment - padding; + public final boolean isGL2GL3() { + return _context.isGL2GL3(); + } + + public final boolean hasGLSL() { + return _context.hasGLSL(); + } + + public final GL4bc getGL4bc() throws GLException { + if(!isGL4bc()) { + throw new GLException("Not a GL4bc implementation"); + } + return this; + } + + public final GL4 getGL4() throws GLException { + if(!isGL4bc()) { + throw new GLException("Not a GL4 implementation"); } + return this; } - /** - * skipPixels and skipRows is a static one time offset. - * - * skipImages and depth are in multiples of image size. - * - * rowlenght is the actual repeating offset - * to go from line n to line n+1 at the same x-axis position. - */ - return - ( skipImages + depth - 1 ) * imageHeight * rowLengthInBytes + // whole images - ( skipRows + height - 1 ) * rowLengthInBytes + // lines with padding - ( skipPixels + width ) * bytesPerElement; // last line -} + public final GL3bc getGL3bc() throws GLException { + if(!isGL3bc()) { + throw new GLException("Not a GL3bc implementation"); + } + return this; + } + + public final GL3 getGL3() throws GLException { + if(!isGL3()) { + throw new GLException("Not a GL3 implementation"); + } + return this; + } + + public final GL2 getGL2() throws GLException { + if(!isGL2()) { + throw new GLException("Not a GL2 implementation"); + } + return this; + } + + public final GL2ES1 getGL2ES1() throws GLException { + if(!isGL2ES1()) { + throw new GLException("Not a GL2ES1 implementation"); + } + return this; + } + + public final GL2ES2 getGL2ES2() throws GLException { + if(!isGL2ES2()) { + throw new GLException("Not a GL2ES2 implementation"); + } + return this; + } + + public final GL2GL3 getGL2GL3() throws GLException { + if(!isGL2GL3()) { + throw new GLException("Not a GL2GL3 implementation"); + } + return this; + } + + public final boolean isGLES1() { + return false; + } + + public final boolean isGLES2() { + return false; + } + + public final boolean isGLES() { + return false; + } + + public final GLES1 getGLES1() throws GLException { + throw new GLException("Not a GLES1 implementation"); + } + + public final GLES2 getGLES2() throws GLException { + throw new GLException("Not a GLES2 implementation"); + } diff --git a/make/config/jogl/gl-impl-CustomJavaCode-gl2.java b/make/config/jogl/gl-impl-CustomJavaCode-gl2.java deleted file mode 100644 index cd1a24459..000000000 --- a/make/config/jogl/gl-impl-CustomJavaCode-gl2.java +++ /dev/null @@ -1,498 +0,0 @@ -// Tracks glBegin/glEnd calls to determine whether it is legal to -// query Vertex Buffer Object state -private boolean inBeginEndPair; - -/* FIXME: refactor dependence on Java 2D / JOGL bridge - -// Tracks creation and destruction of server-side OpenGL objects when -// the Java2D/OpenGL pipeline is enabled and it is using frame buffer -// objects (FBOs) to do its rendering -private GLObjectTracker tracker; - -public void setObjectTracker(GLObjectTracker tracker) { - this.tracker = tracker; -} - -*/ - - -public GL2Impl(GLProfile glp, GLContextImpl context) { - this._context = context; - this.bufferSizeTracker = context.getBufferSizeTracker(); - this.bufferStateTracker = context.getBufferStateTracker(); - this.glStateTracker = context.getGLStateTracker(); - this.glProfile = glp; -} - -public final boolean isGL() { - return true; -} - -public final boolean isGL3bc() { - return false; -} - -public final boolean isGL3() { - return false; -} - -public final boolean isGL2() { - return true; -} - -public final boolean isGLES1() { - return false; -} - -public final boolean isGLES2() { - return false; -} - -public final boolean isGLES() { - return false; -} - -public final boolean isGL2ES1() { - return true; -} - -public final boolean isGL2ES2() { - return true; -} - -public final boolean isGL2GL3() { - return true; -} - -public final boolean hasGLSL() { - return true; -} - -public final GL getGL() throws GLException { - return this; -} - -public final GL3bc getGL3bc() throws GLException { - throw new GLException("Not a GL3bc implementation"); -} - -public final GL3 getGL3() throws GLException { - throw new GLException("Not a GL3 implementation"); -} - -public final GL2 getGL2() throws GLException { - return this; -} - -public final GLES1 getGLES1() throws GLException { - throw new GLException("Not a GLES1 implementation"); -} - -public final GLES2 getGLES2() throws GLException { - throw new GLException("Not a GLES2 implementation"); -} - -public final GL2ES1 getGL2ES1() throws GLException { - return this; -} - -public final GL2ES2 getGL2ES2() throws GLException { - return this; -} - -public final GL2GL3 getGL2GL3() throws GLException { - return this; -} - -public boolean isFunctionAvailable(String glFunctionName) { - return _context.isFunctionAvailable(glFunctionName); -} - -public boolean isExtensionAvailable(String glExtensionName) { - return _context.isExtensionAvailable(glExtensionName); -} - -public Object getExtension(String extensionName) { - // At this point we don't expose any extensions using this mechanism - return null; -} - -/** Returns the context this GL object is associated with for better - error checking by DebugGL. */ -public GLContext getContext() { - return _context; -} - -private GLContextImpl _context; - -/** - * Provides platform-independent access to the wglAllocateMemoryNV / - * glXAllocateMemoryNV extension. - */ -public java.nio.ByteBuffer glAllocateMemoryNV(int arg0, float arg1, float arg2, float arg3) { - return _context.glAllocateMemoryNV(arg0, arg1, arg2, arg3); -} - -public void setSwapInterval(int interval) { - _context.setSwapInterval(interval); -} - -public int getSwapInterval() { - return _context.getSwapInterval(); -} - -public Object getPlatformGLExtensions() { - return _context.getPlatformGLExtensions(); -} - -// -// Helpers for ensuring the correct amount of texture data -// - -/** Returns the number of bytes required to fill in the appropriate - texture. This is computed as closely as possible based on the - pixel pack or unpack parameters. The logic in this routine is - based on code in the SGI OpenGL sample implementation. */ - -private int imageSizeInBytes(int format, int type, int w, int h, int d, - boolean pack) { - int elements = 0; - int esize = 0; - - if (w < 0) return 0; - if (h < 0) return 0; - if (d < 0) return 0; - switch (format) { - case GL_COLOR_INDEX: - case GL_STENCIL_INDEX: - elements = 1; - break; - case GL_RED: - case GL_GREEN: - case GL_BLUE: - case GL_ALPHA: - case GL_LUMINANCE: - case GL_DEPTH_COMPONENT: - elements = 1; - break; - case GL_LUMINANCE_ALPHA: - elements = 2; - break; - case GL_RGB: - case GL_BGR: - elements = 3; - break; - case GL_RGBA: - case GL_BGRA: - case GL_ABGR_EXT: - elements = 4; - break; - /* FIXME ?? - case GL_HILO_NV: - elements = 2; - break; */ - default: - return 0; - } - switch (type) { - case GL_BITMAP: - if (format == GL_COLOR_INDEX) { - return (d * (h * ((w+7)/8))); - } else { - return 0; - } - case GL_BYTE: - case GL_UNSIGNED_BYTE: - esize = 1; - break; - case GL_UNSIGNED_BYTE_3_3_2: - case GL_UNSIGNED_BYTE_2_3_3_REV: - esize = 1; - elements = 1; - break; - case GL_SHORT: - case GL_UNSIGNED_SHORT: - esize = 2; - break; - case GL_UNSIGNED_SHORT_5_6_5: - case GL_UNSIGNED_SHORT_5_6_5_REV: - case GL_UNSIGNED_SHORT_4_4_4_4: - case GL_UNSIGNED_SHORT_4_4_4_4_REV: - case GL_UNSIGNED_SHORT_5_5_5_1: - case GL_UNSIGNED_SHORT_1_5_5_5_REV: - esize = 2; - elements = 1; - break; - case GL_INT: - case GL_UNSIGNED_INT: - case GL_FLOAT: - esize = 4; - break; - case GL_UNSIGNED_INT_8_8_8_8: - case GL_UNSIGNED_INT_8_8_8_8_REV: - case GL_UNSIGNED_INT_10_10_10_2: - case GL_UNSIGNED_INT_2_10_10_10_REV: - esize = 4; - elements = 1; - break; - default: - return 0; - } - return imageSizeInBytes(elements * esize, w, h, d, pack); -} - -private GLBufferSizeTracker bufferSizeTracker; -private GLBufferStateTracker bufferStateTracker; -private GLStateTracker glStateTracker; - -private boolean bufferObjectExtensionsInitialized = false; -private boolean haveARBPixelBufferObject; -private boolean haveEXTPixelBufferObject; -private boolean haveGL15; -private boolean haveGL21; -private boolean haveARBVertexBufferObject; - -private void initBufferObjectExtensionChecks() { - if (bufferObjectExtensionsInitialized) - return; - bufferObjectExtensionsInitialized = true; - haveARBPixelBufferObject = isExtensionAvailable("GL_ARB_pixel_buffer_object"); - haveEXTPixelBufferObject = isExtensionAvailable("GL_EXT_pixel_buffer_object"); - haveGL15 = isExtensionAvailable("GL_VERSION_1_5"); - haveGL21 = isExtensionAvailable("GL_VERSION_2_1"); - haveARBVertexBufferObject = isExtensionAvailable("GL_ARB_vertex_buffer_object"); -} - -private boolean checkBufferObject(boolean extension1, - boolean extension2, - boolean extension3, - boolean enabled, - int state, - String kind, boolean throwException) { - if (inBeginEndPair) { - throw new GLException("May not call this between glBegin and glEnd"); - } - boolean avail = (extension1 || extension2 || extension3); - if (!avail) { - if (!enabled) - return true; - if(throwException) { - throw new GLException("Required extensions not available to call this function"); - } - return false; - } - int buffer = bufferStateTracker.getBoundBufferObject(state, this); - if (enabled) { - if (buffer == 0) { - if(throwException) { - throw new GLException(kind + " must be enabled to call this method"); - } - return false; - } - } else { - if (buffer != 0) { - if(throwException) { - throw new GLException(kind + " must be disabled to call this method"); - } - return false; - } - } - return true; -} - -private boolean checkArrayVBODisabled(boolean throwException) { - initBufferObjectExtensionChecks(); - return checkBufferObject(haveGL15, - haveARBVertexBufferObject, - false, - false, - GL.GL_ARRAY_BUFFER, - "array vertex_buffer_object", throwException); -} - -private boolean checkArrayVBOEnabled(boolean throwException) { - initBufferObjectExtensionChecks(); - return checkBufferObject(haveGL15, - haveARBVertexBufferObject, - false, - true, - GL.GL_ARRAY_BUFFER, - "array vertex_buffer_object", throwException); -} - -private boolean checkElementVBODisabled(boolean throwException) { - initBufferObjectExtensionChecks(); - return checkBufferObject(haveGL15, - haveARBVertexBufferObject, - false, - false, - GL.GL_ELEMENT_ARRAY_BUFFER, - "element vertex_buffer_object", throwException); -} - -private boolean checkElementVBOEnabled(boolean throwException) { - initBufferObjectExtensionChecks(); - return checkBufferObject(haveGL15, - haveARBVertexBufferObject, - false, - true, - GL.GL_ELEMENT_ARRAY_BUFFER, - "element vertex_buffer_object", throwException); -} - -private boolean checkUnpackPBODisabled(boolean throwException) { - initBufferObjectExtensionChecks(); - return checkBufferObject(haveARBPixelBufferObject, - haveEXTPixelBufferObject, - haveGL21, - false, - GL2.GL_PIXEL_UNPACK_BUFFER, - "unpack pixel_buffer_object", throwException); -} - -private boolean checkUnpackPBOEnabled(boolean throwException) { - initBufferObjectExtensionChecks(); - return checkBufferObject(haveARBPixelBufferObject, - haveEXTPixelBufferObject, - haveGL21, - true, - GL2.GL_PIXEL_UNPACK_BUFFER, - "unpack pixel_buffer_object", throwException); -} - -private boolean checkPackPBODisabled(boolean throwException) { - initBufferObjectExtensionChecks(); - return checkBufferObject(haveARBPixelBufferObject, - haveEXTPixelBufferObject, - haveGL21, - false, - GL2.GL_PIXEL_PACK_BUFFER, - "pack pixel_buffer_object", throwException); -} - -private boolean checkPackPBOEnabled(boolean throwException) { - initBufferObjectExtensionChecks(); - return checkBufferObject(haveARBPixelBufferObject, - haveEXTPixelBufferObject, - haveGL21, - true, - GL2.GL_PIXEL_PACK_BUFFER, - "pack pixel_buffer_object", throwException); -} - -public boolean glIsPBOPackEnabled() { - return checkPackPBOEnabled(false); -} - -public boolean glIsPBOUnpackEnabled() { - return checkUnpackPBOEnabled(false); -} - -// Attempt to return the same ByteBuffer object from glMapBuffer if -// the vertex buffer object's base address and size haven't changed -private static class ARBVBOKey { - private long addr; - private int capacity; - - ARBVBOKey(long addr, int capacity) { - this.addr = addr; - this.capacity = capacity; - } - - public int hashCode() { - return (int) addr; - } - - public boolean equals(Object o) { - if ((o == null) || (!(o instanceof ARBVBOKey))) { - return false; - } - - ARBVBOKey other = (ARBVBOKey) o; - return ((addr == other.addr) && (capacity == other.capacity)); - } -} - -private Map/*<ARBVBOKey, ByteBuffer>*/ arbVBOCache = new HashMap(); - -/** Entry point to C language function: <br> <code> LPVOID glMapBuffer(GLenum target, GLenum access); </code> */ -public java.nio.ByteBuffer glMapBuffer(int target, int access) { - final long __addr_ = ((GL2ProcAddressTable)_context.getGLProcAddressTable())._addressof_glMapBuffer; - if (__addr_ == 0) { - throw new GLException("Method \"glMapBuffer\" not available"); - } - int sz = bufferSizeTracker.getBufferSize(bufferStateTracker, - target, - this); - long addr; - addr = dispatch_glMapBuffer(target, access, __addr_); - if (addr == 0 || sz == 0) { - return null; - } - ARBVBOKey key = new ARBVBOKey(addr, sz); - ByteBuffer _res = (ByteBuffer) arbVBOCache.get(key); - if (_res == null) { - _res = newDirectByteBuffer(addr, sz); - InternalBufferUtil.nativeOrder(_res); - arbVBOCache.put(key, _res); - } - _res.position(0); - return _res; -} - -/** Encapsulates function pointer for OpenGL function <br>: <code> LPVOID glMapBuffer(GLenum target, GLenum access); </code> */ -native private long dispatch_glMapBuffer(int target, int access, long glProcAddress); - -native private ByteBuffer newDirectByteBuffer(long addr, int capacity); - - /** Dummy implementation for the ES 2.0 function: <br> <code> void {@native glShaderBinary}(GLint n, const GLuint * shaders, GLenum binaryformat, const void * binary, GLint length); </code> <br> Always throws a GLException! */ - public void glShaderBinary(int n, java.nio.IntBuffer shaders, int binaryformat, java.nio.Buffer binary, int length) { - throw new GLException("Method \"glShaderBinary\" not available"); - } - - /** Dummy implementation for the ES 2.0 function: <br> <code> void {@native glShaderBinary}(GLint n, const GLuint * shaders, GLenum binaryformat, const void * binary, GLint length); </code> <br> Always throws a GLException! */ - public void glShaderBinary(int n, int[] shaders, int shaders_offset, int binaryformat, java.nio.Buffer binary, int length) { - throw new GLException("Method \"glShaderBinary\" not available"); - } - - public void glReleaseShaderCompiler() { - // nothing to do - } - - public void glVertexPointer(GLArrayData array) { - if(array.getComponentNumber()==0) return; - if(array.isVBO()) { - glVertexPointer(array.getComponentNumber(), array.getComponentType(), array.getStride(), array.getOffset()); - } else { - glVertexPointer(array.getComponentNumber(), array.getComponentType(), array.getStride(), array.getBuffer()); - } - } - public void glColorPointer(GLArrayData array) { - if(array.getComponentNumber()==0) return; - if(array.isVBO()) { - glColorPointer(array.getComponentNumber(), array.getComponentType(), array.getStride(), array.getOffset()); - } else { - glColorPointer(array.getComponentNumber(), array.getComponentType(), array.getStride(), array.getBuffer()); - } - - } - public void glNormalPointer(GLArrayData array) { - if(array.getComponentNumber()==0) return; - if(array.getComponentNumber()!=3) { - throw new GLException("Only 3 components per normal allowed"); - } - if(array.isVBO()) { - glNormalPointer(array.getComponentType(), array.getStride(), array.getOffset()); - } else { - glNormalPointer(array.getComponentType(), array.getStride(), array.getBuffer()); - } - } - public void glTexCoordPointer(GLArrayData array) { - if(array.getComponentNumber()==0) return; - if(array.isVBO()) { - glTexCoordPointer(array.getComponentNumber(), array.getComponentType(), array.getStride(), array.getOffset()); - } else { - glTexCoordPointer(array.getComponentNumber(), array.getComponentType(), array.getStride(), array.getBuffer()); - } - } - diff --git a/make/config/jogl/gl-impl-CustomJavaCode-gl2es12.java b/make/config/jogl/gl-impl-CustomJavaCode-gl2es12.java index 2eca2b6ab..4bc39b076 100644 --- a/make/config/jogl/gl-impl-CustomJavaCode-gl2es12.java +++ b/make/config/jogl/gl-impl-CustomJavaCode-gl2es12.java @@ -26,8 +26,12 @@ public GL2ES12Impl(GLProfile glp, GLContextImpl context) { private boolean isGL2ES2; -public final boolean isGL() { - return true; +public final boolean isGL4bc() { + return false; +} + +public final boolean isGL4() { + return false; } public final boolean isGL3bc() { @@ -70,8 +74,12 @@ public final boolean hasGLSL() { return isGL2ES2; } -public final GL getGL() throws GLException { - return this; +public final GL4bc getGL4bc() throws GLException { + throw new GLException("Not a GL4bc implementation"); +} + +public final GL4 getGL4() throws GLException { + throw new GLException("Not a GL4 implementation"); } public final GL3bc getGL3bc() throws GLException { @@ -112,39 +120,6 @@ public final GL2GL3 getGL2GL3() throws GLException { throw new GLException("Not a GL2GL3 implementation"); } -public boolean isFunctionAvailable(String glFunctionName) { - return _context.isFunctionAvailable(glFunctionName); -} - -public boolean isExtensionAvailable(String glExtensionName) { - return _context.isExtensionAvailable(glExtensionName); -} - -public Object getExtension(String extensionName) { - // At this point we don't expose any extensions using this mechanism - return null; -} - -/** Returns the context this GL object is associated with for better - error checking by DebugGL. */ -public GLContext getContext() { - return _context; -} - -private GLContextImpl _context; - -public void setSwapInterval(int interval) { - _context.setSwapInterval(interval); -} - -public int getSwapInterval() { - return _context.getSwapInterval(); -} - -public Object getPlatformGLExtensions() { - return _context.getPlatformGLExtensions(); -} - // // Helpers for ensuring the correct amount of texture data // diff --git a/make/config/jogl/gl-impl-CustomJavaCode-gl3.java b/make/config/jogl/gl-impl-CustomJavaCode-gl4.java index 16ff008cf..a2c70eeee 100644 --- a/make/config/jogl/gl-impl-CustomJavaCode-gl3.java +++ b/make/config/jogl/gl-impl-CustomJavaCode-gl4.java @@ -23,107 +23,6 @@ public GL3Impl(GLProfile glp, GLContextImpl context) { this.glProfile = glp; } -public final boolean isGL() { - return true; -} - -public final boolean isGL3bc() { - return false; -} - -public final boolean isGL3() { - return true; -} - -public final boolean isGL2() { - return false; -} - -public final boolean isGLES1() { - return false; -} - -public final boolean isGLES2() { - return false; -} - -public final boolean isGLES() { - return false; -} - -public final boolean isGL2ES1() { - return false; -} - -public final boolean isGL2ES2() { - return true; -} - -public final boolean isGL2GL3() { - return true; -} - -public final boolean hasGLSL() { - return true; -} - -public final GL getGL() throws GLException { - return this; -} - -public final GL3bc getGL3bc() throws GLException { - throw new GLException("Not a GL3bc implementation"); -} - -public final GL3 getGL3() throws GLException { - return this; -} - -public final GL2 getGL2() throws GLException { - throw new GLException("Not a GL2 implementation"); -} - -public final GLES1 getGLES1() throws GLException { - throw new GLException("Not a GLES1 implementation"); -} - -public final GLES2 getGLES2() throws GLException { - throw new GLException("Not a GLES2 implementation"); -} - -public final GL2ES1 getGL2ES1() throws GLException { - throw new GLException("Not a GLES2ES1 implementation"); -} - -public final GL2ES2 getGL2ES2() throws GLException { - return this; -} - -public final GL2GL3 getGL2GL3() throws GLException { - return this; -} - -public boolean isFunctionAvailable(String glFunctionName) { - return _context.isFunctionAvailable(glFunctionName); -} - -public boolean isExtensionAvailable(String glExtensionName) { - return _context.isExtensionAvailable(glExtensionName); -} - -public Object getExtension(String extensionName) { - // At this point we don't expose any extensions using this mechanism - return null; -} - -/** Returns the context this GL object is associated with for better - error checking by DebugGL. */ -public GLContext getContext() { - return _context; -} - -private GLContextImpl _context; - /** * Provides platform-independent access to the wglAllocateMemoryNV / * glXAllocateMemoryNV extension. @@ -132,18 +31,6 @@ public java.nio.ByteBuffer glAllocateMemoryNV(int arg0, float arg1, float arg2, return _context.glAllocateMemoryNV(arg0, arg1, arg2, arg3); } -public void setSwapInterval(int interval) { - _context.setSwapInterval(interval); -} - -public int getSwapInterval() { - return _context.getSwapInterval(); -} - -public Object getPlatformGLExtensions() { - return _context.getPlatformGLExtensions(); -} - // // Helpers for ensuring the correct amount of texture data // diff --git a/make/config/jogl/gl-impl-CustomJavaCode-gl3bc.java b/make/config/jogl/gl-impl-CustomJavaCode-gl4bc.java index 2b7f14918..bceb12fe5 100644 --- a/make/config/jogl/gl-impl-CustomJavaCode-gl3bc.java +++ b/make/config/jogl/gl-impl-CustomJavaCode-gl4bc.java @@ -16,7 +16,7 @@ public void setObjectTracker(GLObjectTracker tracker) { */ -public GL3bcImpl(GLProfile glp, GLContextImpl context) { +public GL4bcImpl(GLProfile glp, GLContextImpl context) { this._context = context; this.bufferSizeTracker = context.getBufferSizeTracker(); this.bufferStateTracker = context.getBufferStateTracker(); @@ -24,107 +24,6 @@ public GL3bcImpl(GLProfile glp, GLContextImpl context) { this.glProfile = glp; } -public final boolean isGL() { - return true; -} - -public final boolean isGL3bc() { - return true; -} - -public final boolean isGL3() { - return true; -} - -public final boolean isGL2() { - return true; -} - -public final boolean isGLES1() { - return false; -} - -public final boolean isGLES2() { - return false; -} - -public final boolean isGLES() { - return false; -} - -public final boolean isGL2ES1() { - return true; -} - -public final boolean isGL2ES2() { - return true; -} - -public final boolean isGL2GL3() { - return true; -} - -public final boolean hasGLSL() { - return true; -} - -public final GL getGL() throws GLException { - return this; -} - -public final GL3bc getGL3bc() throws GLException { - return this; -} - -public final GL3 getGL3() throws GLException { - return this; -} - -public final GL2 getGL2() throws GLException { - return this; -} - -public final GLES1 getGLES1() throws GLException { - throw new GLException("Not a GLES1 implementation"); -} - -public final GLES2 getGLES2() throws GLException { - throw new GLException("Not a GLES2 implementation"); -} - -public final GL2ES1 getGL2ES1() throws GLException { - return this; -} - -public final GL2ES2 getGL2ES2() throws GLException { - return this; -} - -public final GL2GL3 getGL2GL3() throws GLException { - return this; -} - -public boolean isFunctionAvailable(String glFunctionName) { - return _context.isFunctionAvailable(glFunctionName); -} - -public boolean isExtensionAvailable(String glExtensionName) { - return _context.isExtensionAvailable(glExtensionName); -} - -public Object getExtension(String extensionName) { - // At this point we don't expose any extensions using this mechanism - return null; -} - -/** Returns the context this GL object is associated with for better - error checking by DebugGL. */ -public GLContext getContext() { - return _context; -} - -private GLContextImpl _context; - /** * Provides platform-independent access to the wglAllocateMemoryNV / * glXAllocateMemoryNV extension. @@ -133,18 +32,6 @@ public java.nio.ByteBuffer glAllocateMemoryNV(int arg0, float arg1, float arg2, return _context.glAllocateMemoryNV(arg0, arg1, arg2, arg3); } -public void setSwapInterval(int interval) { - _context.setSwapInterval(interval); -} - -public int getSwapInterval() { - return _context.getSwapInterval(); -} - -public Object getPlatformGLExtensions() { - return _context.getPlatformGLExtensions(); -} - // // Helpers for ensuring the correct amount of texture data // @@ -417,7 +304,7 @@ private Map/*<ARBVBOKey, ByteBuffer>*/ arbVBOCache = new HashMap(); /** Entry point to C language function: <br> <code> LPVOID glMapBuffer(GLenum target, GLenum access); </code> */ public java.nio.ByteBuffer glMapBuffer(int target, int access) { - final long __addr_ = ((GL3bcProcAddressTable)_context.getGLProcAddressTable())._addressof_glMapBuffer; + final long __addr_ = ((GL4bcProcAddressTable)_context.getGLProcAddressTable())._addressof_glMapBuffer; if (__addr_ == 0) { throw new GLException("Method \"glMapBuffer\" not available"); } diff --git a/make/config/jogl/gl-impl-CustomJavaCode-gles1.java b/make/config/jogl/gl-impl-CustomJavaCode-gles1.java index dfef10ec9..b4efac8a1 100755 --- a/make/config/jogl/gl-impl-CustomJavaCode-gles1.java +++ b/make/config/jogl/gl-impl-CustomJavaCode-gles1.java @@ -6,10 +6,14 @@ public GLES1Impl(GLProfile glp, GLContextImpl context) { this.glProfile = glp; } -public final boolean isGL() { - return true; +public final boolean isGL4bc() { + return false; } - + +public final boolean isGL4() { + return false; +} + public final boolean isGL3bc() { return false; } @@ -50,8 +54,12 @@ public final boolean hasGLSL() { return false; } -public final GL getGL() throws GLException { - return this; +public final GL4bc getGL4bc() throws GLException { + throw new GLException("Not a GL4bc implementation"); +} + +public final GL4 getGL4() throws GLException { + throw new GLException("Not a GL4 implementation"); } public final GL3bc getGL3bc() throws GLException { @@ -86,39 +94,6 @@ public final GL2GL3 getGL2GL3() throws GLException { throw new GLException("Not a GL2GL3 implementation"); } -public boolean isFunctionAvailable(String glFunctionName) { - return _context.isFunctionAvailable(glFunctionName); -} - -public boolean isExtensionAvailable(String glExtensionName) { - return _context.isExtensionAvailable(glExtensionName); -} - -public Object getExtension(String extensionName) { - // At this point we don't expose any extensions using this mechanism - return null; -} - -/** Returns the context this GL object is associated with for better - error checking by DebugGL. */ -public GLContext getContext() { - return _context; -} - -private GLContextImpl _context; - -public void setSwapInterval(int interval) { - _context.setSwapInterval(interval); -} - -public int getSwapInterval() { - return _context.getSwapInterval(); -} - -public Object getPlatformGLExtensions() { - return _context.getPlatformGLExtensions(); -} - // // Helpers for ensuring the correct amount of texture data // diff --git a/make/config/jogl/gl-impl-CustomJavaCode-gles2.java b/make/config/jogl/gl-impl-CustomJavaCode-gles2.java index 7287408a0..bb8ddb7ef 100755 --- a/make/config/jogl/gl-impl-CustomJavaCode-gles2.java +++ b/make/config/jogl/gl-impl-CustomJavaCode-gles2.java @@ -10,10 +10,14 @@ public GLES2Impl(GLProfile glp, GLContextImpl context) { this.glProfile = glp; } -public final boolean isGL() { - return true; +public final boolean isGL4bc() { + return false; } - + +public final boolean isGL4() { + return false; +} + public final boolean isGL3bc() { return false; } @@ -54,8 +58,12 @@ public final boolean hasGLSL() { return true; } -public final GL getGL() throws GLException { - return this; +public final GL4bc getGL4bc() throws GLException { + throw new GLException("Not a GL4bc implementation"); +} + +public final GL4 getGL4() throws GLException { + throw new GLException("Not a GL4 implementation"); } public final GL3bc getGL3bc() throws GLException { @@ -90,39 +98,6 @@ public final GL2GL3 getGL2GL3() throws GLException { throw new GLException("Not a GL2GL3 implementation"); } -public boolean isFunctionAvailable(String glFunctionName) { - return _context.isFunctionAvailable(glFunctionName); -} - -public boolean isExtensionAvailable(String glExtensionName) { - return _context.isExtensionAvailable(glExtensionName); -} - -public Object getExtension(String extensionName) { - // At this point we don't expose any extensions using this mechanism - return null; -} - -/** Returns the context this GL object is associated with for better - error checking by DebugGL. */ -public GLContext getContext() { - return _context; -} - -private GLContextImpl _context; - -public void setSwapInterval(int interval) { - _context.setSwapInterval(interval); -} - -public int getSwapInterval() { - return _context.getSwapInterval(); -} - -public Object getPlatformGLExtensions() { - return _context.getPlatformGLExtensions(); -} - // // Helpers for ensuring the correct amount of texture data // diff --git a/make/config/jogl/gl3-common.cfg b/make/config/jogl/gl3-common.cfg index fac8323bb..c2cc2968e 100644 --- a/make/config/jogl/gl3-common.cfg +++ b/make/config/jogl/gl3-common.cfg @@ -16,6 +16,9 @@ RenameExtensionIntoCore GL_ARB_geometry_shader4 RenameExtensionIntoCore GL_ARB_sync # <<< OpenGL 3.2 +# >>> OpenGL 3.3 +# <<< OpenGL 3.3 + # Ignore GL functions that deal with explicit pointer values in such a # way that we cannot implement the functionality in Java Ignore glMultiDrawElementsBaseVertex diff --git a/make/config/jogl/gl3-desktop.cfg b/make/config/jogl/gl3-desktop.cfg index c3dd180bb..ee741089e 100755 --- a/make/config/jogl/gl3-desktop.cfg +++ b/make/config/jogl/gl3-desktop.cfg @@ -61,6 +61,6 @@ TemporaryCVariableDeclaration glXChooseFBConfigSGIX int count; TemporaryCVariableAssignment glXChooseFBConfigSGIX count = _ptr3[0]; ReturnValueCapacity glXChooseFBConfigSGIX count * sizeof(GLXFBConfig) TemporaryCVariableDeclaration glXGetFBConfigs int count; -TemporaryCVariableAssignment glXGetFBConfigs count = _ptr2[0]; +TemporaryCVariableAssignment glXGetFBConfigs count = _nelements_ptr[0]; ReturnValueCapacity glXGetFBConfigs count * sizeof(GLXFBConfig) diff --git a/make/config/jogl/gl3ext-headers.cfg b/make/config/jogl/gl3ext-headers.cfg new file mode 100755 index 000000000..dfc4ea796 --- /dev/null +++ b/make/config/jogl/gl3ext-headers.cfg @@ -0,0 +1,5 @@ +CustomCCode /* Define GL_GL3EXT_PROTOTYPES so that the OpenGL extension prototypes in +CustomCCode "gl3ext.h" are parsed. */ +CustomCCode #define GL_GL3EXT_PROTOTYPES +CustomCCode #include <GL3/gl3ext.h> +CustomCCode #include <GL3/gl3ext.h> diff --git a/make/config/jogl/gl4-common.cfg b/make/config/jogl/gl4-common.cfg new file mode 100644 index 000000000..2c119da30 --- /dev/null +++ b/make/config/jogl/gl4-common.cfg @@ -0,0 +1,5 @@ + +# >>> OpenGL 4.0 +# <<< OpenGL 4.0 + + diff --git a/make/config/jogl/gl3-desktop-tracker.cfg b/make/config/jogl/gl4-desktop-tracker.cfg index 4b9a7edb7..4b9a7edb7 100644 --- a/make/config/jogl/gl3-desktop-tracker.cfg +++ b/make/config/jogl/gl4-desktop-tracker.cfg diff --git a/make/config/jogl/glu-CustomJavaCode-base.java b/make/config/jogl/glu-CustomJavaCode-base.java index 78c067606..480f5d117 100755 --- 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 = NWReflection.isClassAvailable("com.sun.opengl.impl.glu.tessellator.GLUtessellatorImpl"); + availableGLUtessellatorImpl = ReflectionUtil.isClassAvailable("com.jogamp.opengl.impl.glu.tessellator.GLUtessellatorImpl"); checkedGLUtessellatorImpl = true; } if(!availableGLUtessellatorImpl) { @@ -1220,7 +1220,7 @@ protected static final void validateGLUquadricImpl() { if(!checkedGLUquadricImpl) { synchronized (syncObject) { if(!checkedGLUquadricImpl) { - availableGLUquadricImpl = NWReflection.isClassAvailable("com.sun.opengl.impl.glu.GLUquadricImpl"); + availableGLUquadricImpl = ReflectionUtil.isClassAvailable("com.jogamp.opengl.impl.glu.GLUquadricImpl"); checkedGLUquadricImpl = true; } } diff --git a/make/config/jogl/glu-CustomJavaCode-gl2es1.java b/make/config/jogl/glu-CustomJavaCode-gl2es1.java index 8afc28c15..f3b4322d9 100755 --- 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 = NWReflection.isClassAvailable("com.sun.opengl.impl.glu.mipmap.Mipmap"); + availableMipmap = ReflectionUtil.isClassAvailable("com.jogamp.opengl.impl.glu.mipmap.Mipmap"); checkedMipmap = true; } if(!availableMipmap) { diff --git a/make/config/jogl/glu-base.cfg b/make/config/jogl/glu-base.cfg index f67673a78..d859225ec 100755 --- 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.sun.opengl.impl.glu.error.Error -Import com.sun.opengl.impl.glu.registry.Registry +Import com.jogamp.opengl.impl.glu.error.Error +Import com.jogamp.opengl.impl.glu.registry.Registry Include glu-common.cfg diff --git a/make/config/jogl/glu-common.cfg b/make/config/jogl/glu-common.cfg index df59175bb..f5fc7c1b3 100644 --- a/make/config/jogl/glu-common.cfg +++ b/make/config/jogl/glu-common.cfg @@ -9,13 +9,12 @@ TagNativeBinding true # # Imports needed by all glue code # -Import java.nio.* Import javax.media.opengl.* Import javax.media.opengl.glu.* -Import com.sun.opengl.impl.* -Import com.sun.opengl.impl.glu.* -Import com.sun.opengl.impl.glu.tessellator.GLUtessellatorImpl -Import com.sun.nativewindow.impl.NWReflection +Import com.jogamp.opengl.impl.* +Import com.jogamp.opengl.impl.glu.* +Import com.jogamp.opengl.impl.glu.tessellator.GLUtessellatorImpl +Import com.jogamp.common.util.ReflectionUtil # Raise GLException instead of RuntimeException in glue code RuntimeExceptionType GLException diff --git a/make/config/jogl/glu-gl2.cfg b/make/config/jogl/glu-gl2.cfg index 712f9a305..cc5b16f0f 100755 --- 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.sun.opengl.impl.glu.gl2 +ProcAddressTablePackage com.jogamp.opengl.impl.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.sun.opengl.impl.glu.nurbs.* +Import com.jogamp.opengl.impl.glu.nurbs.* Import java.security.* -Import com.sun.gluegen.runtime.opengl.GLProcAddressHelper -Import com.sun.opengl.impl.glu.gl2.nurbs.* -Import com.sun.opengl.impl.glu.mipmap.Mipmap -Import com.sun.opengl.impl.glu.gl2.* +Import com.jogamp.gluegen.runtime.opengl.GLProcAddressHelper +Import com.jogamp.opengl.impl.glu.gl2.nurbs.* +Import com.jogamp.opengl.impl.glu.mipmap.Mipmap +Import com.jogamp.opengl.impl.glu.gl2.* Import javax.media.opengl.GL2 -Import com.sun.opengl.impl.gl2.ProjectDouble +Import com.jogamp.opengl.impl.gl2.ProjectDouble # # ------------------------ diff --git a/make/config/jogl/glu-gl2es1.cfg b/make/config/jogl/glu-gl2es1.cfg index 8927f96b9..af89014f4 100755 --- 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.sun.opengl.impl.glu.mipmap.Mipmap +Import com.jogamp.opengl.impl.glu.mipmap.Mipmap Include glu-common.cfg diff --git a/make/config/jogl/glx-CustomCCode.c b/make/config/jogl/glx-CustomCCode.c index a075c4852..1b30a7da6 100755 --- a/make/config/jogl/glx-CustomCCode.c +++ b/make/config/jogl/glx-CustomCCode.c @@ -15,7 +15,7 @@ /* We expect glXGetProcAddressARB to be defined */ extern void (*glXGetProcAddressARB(const GLubyte *procname))(); -static const char * clazzNameInternalBufferUtil = "com/sun/opengl/impl/InternalBufferUtil"; +static const char * clazzNameInternalBufferUtil = "com/jogamp/opengl/impl/InternalBufferUtil"; static const char * clazzNameInternalBufferUtilStaticCstrName = "copyByteBuffer"; static const char * clazzNameInternalBufferUtilStaticCstrSignature = "(Ljava/nio/ByteBuffer;)Ljava/nio/ByteBuffer;"; static const char * clazzNameByteBuffer = "java/nio/ByteBuffer"; @@ -30,29 +30,29 @@ static void _initClazzAccess(JNIEnv *env) { c = (*env)->FindClass(env, clazzNameInternalBufferUtil); if(NULL==c) { - fprintf(stderr, "FatalError: Java_com_sun_opengl_impl_x11_glx_GLX: can't find %s\n", clazzNameInternalBufferUtil); + fprintf(stderr, "FatalError: Java_com_jogamp_opengl_impl_x11_glx_GLX: can't find %s\n", clazzNameInternalBufferUtil); (*env)->FatalError(env, clazzNameInternalBufferUtil); } clazzInternalBufferUtil = (jclass)(*env)->NewGlobalRef(env, c); if(NULL==clazzInternalBufferUtil) { - fprintf(stderr, "FatalError: Java_com_sun_opengl_impl_x11_glx_GLX: can't use %s\n", clazzNameInternalBufferUtil); + fprintf(stderr, "FatalError: Java_com_jogamp_opengl_impl_x11_glx_GLX: can't use %s\n", clazzNameInternalBufferUtil); (*env)->FatalError(env, clazzNameInternalBufferUtil); } c = (*env)->FindClass(env, clazzNameByteBuffer); if(NULL==c) { - fprintf(stderr, "FatalError: Java_com_sun_opengl_impl_x11_glx_GLX: can't find %s\n", clazzNameByteBuffer); + fprintf(stderr, "FatalError: Java_com_jogamp_opengl_impl_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_sun_opengl_impl_x11_glx_GLX: can't use %s\n", clazzNameByteBuffer); + fprintf(stderr, "FatalError: Java_com_jogamp_opengl_impl_x11_glx_GLX: can't use %s\n", clazzNameByteBuffer); (*env)->FatalError(env, clazzNameByteBuffer); } cstrInternalBufferUtil = (*env)->GetStaticMethodID(env, clazzInternalBufferUtil, clazzNameInternalBufferUtilStaticCstrName, clazzNameInternalBufferUtilStaticCstrSignature); if(NULL==cstrInternalBufferUtil) { - fprintf(stderr, "FatalError: Java_com_sun_opengl_impl_x11_glx_GLX:: can't create %s.%s %s\n", + fprintf(stderr, "FatalError: Java_com_jogamp_opengl_impl_x11_glx_GLX:: can't create %s.%s %s\n", clazzNameInternalBufferUtil, clazzNameInternalBufferUtilStaticCstrName, clazzNameInternalBufferUtilStaticCstrSignature); (*env)->FatalError(env, clazzNameInternalBufferUtilStaticCstrName); @@ -60,12 +60,12 @@ static void _initClazzAccess(JNIEnv *env) { } /* Java->C glue code: - * Java package: com.sun.opengl.impl.x11.glx.GLX + * Java package: com.jogamp.opengl.impl.x11.glx.GLX * Java method: XVisualInfo glXGetVisualFromFBConfig(long dpy, long config) * C function: XVisualInfo * glXGetVisualFromFBConfig(Display * dpy, GLXFBConfig config); */ JNIEXPORT jobject JNICALL -Java_com_sun_opengl_impl_x11_glx_GLX_glXGetVisualFromFBConfigCopied0__JJ(JNIEnv *env, jclass _unused, jlong dpy, jlong config) { +Java_com_jogamp_opengl_impl_x11_glx_GLX_glXGetVisualFromFBConfigCopied0__JJ(JNIEnv *env, jclass _unused, jlong dpy, jlong config) { XVisualInfo * _res; jobject jbyteSource; jobject jbyteCopy; @@ -78,19 +78,19 @@ Java_com_sun_opengl_impl_x11_glx_GLX_glXGetVisualFromFBConfigCopied0__JJ(JNIEnv jbyteCopy = (*env)->CallStaticObjectMethod(env, clazzInternalBufferUtil, cstrInternalBufferUtil, jbyteSource); - // FIXME: remove reference/gc jbyteSource ?? + (*env)->DeleteLocalRef(env, jbyteSource); XFree(_res); return jbyteCopy; } /* Java->C glue code: - * Java package: com.sun.opengl.impl.x11.glx.GLX + * Java package: com.jogamp.opengl.impl.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_sun_opengl_impl_x11_glx_GLX_glXChooseFBConfigCopied1__JILjava_lang_Object_2ILjava_lang_Object_2I(JNIEnv *env, jclass _unused, jlong dpy, jint screen, jobject attribList, jint attribList_byte_offset, jobject nitems, jint nitems_byte_offset) { +Java_com_jogamp_opengl_impl_x11_glx_GLX_glXChooseFBConfigCopied1__JILjava_lang_Object_2ILjava_lang_Object_2I(JNIEnv *env, jclass _unused, jlong dpy, jint screen, jobject attribList, jint attribList_byte_offset, jobject nitems, jint nitems_byte_offset) { int * _ptr2 = NULL; int * _ptr3 = NULL; GLXFBConfig * _res; @@ -118,20 +118,19 @@ Java_com_sun_opengl_impl_x11_glx_GLX_glXChooseFBConfigCopied1__JILjava_lang_Obje jbyteSource = (*env)->NewDirectByteBuffer(env, _res, count * sizeof(GLXFBConfig)); jbyteCopy = (*env)->CallStaticObjectMethod(env, clazzInternalBufferUtil, cstrInternalBufferUtil, jbyteSource); - - // FIXME: remove reference/gc jbyteSource ?? + (*env)->DeleteLocalRef(env, jbyteSource); XFree(_res); return jbyteCopy; } /* Java->C glue code: - * Java package: com.sun.opengl.impl.x11.glx.GLX + * Java package: com.jogamp.opengl.impl.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_sun_opengl_impl_x11_glx_GLX_glXChooseVisualCopied1__JILjava_lang_Object_2I(JNIEnv *env, jclass _unused, jlong dpy, jint screen, jobject attribList, jint attribList_byte_offset) { +Java_com_jogamp_opengl_impl_x11_glx_GLX_glXChooseVisualCopied1__JILjava_lang_Object_2I(JNIEnv *env, jclass _unused, jlong dpy, jint screen, jobject attribList, jint attribList_byte_offset) { int * _ptr2 = NULL; XVisualInfo * _res; jobject jbyteSource; @@ -151,7 +150,7 @@ Java_com_sun_opengl_impl_x11_glx_GLX_glXChooseVisualCopied1__JILjava_lang_Object jbyteCopy = (*env)->CallStaticObjectMethod(env, clazzInternalBufferUtil, cstrInternalBufferUtil, jbyteSource); - // FIXME: remove reference/gc jbyteSource ?? + (*env)->DeleteLocalRef(env, jbyteSource); XFree(_res); return jbyteCopy; diff --git a/make/config/jogl/glx-CustomJavaCode.java b/make/config/jogl/glx-CustomJavaCode.java index 25a6156b7..fe81cd64a 100644 --- a/make/config/jogl/glx-CustomJavaCode.java +++ b/make/config/jogl/glx-CustomJavaCode.java @@ -13,17 +13,17 @@ /** Interface to C language function: <br> - Alias for: <br> <code> GLXFBConfig * glXChooseFBConfigSGIX, glXChooseFBConfig(Display * dpy, int screen, const int * attribList, int * nitems); </code> */ - public static com.sun.gluegen.runtime.PointerBuffer glXChooseFBConfigCopied(long dpy, int screen, int[] attribList, int attribList_offset, int[] nitems, int nitems_offset) + public static com.jogamp.common.nio.PointerBuffer glXChooseFBConfigCopied(long dpy, int screen, int[] attribList, int attribList_offset, int[] nitems, int nitems_offset) { if(attribList != null && attribList.length <= attribList_offset) throw new GLException("array offset argument \"attribList_offset\" (" + attribList_offset + ") equals or exceeds array length (" + attribList.length + ")"); if(nitems != null && nitems.length <= nitems_offset) throw new GLException("array offset argument \"nitems_offset\" (" + nitems_offset + ") equals or exceeds array length (" + nitems.length + ")"); java.nio.ByteBuffer _res; - _res = glXChooseFBConfigCopied1(dpy, screen, attribList, BufferFactory.SIZEOF_INT * attribList_offset, nitems, BufferFactory.SIZEOF_INT * nitems_offset); + _res = glXChooseFBConfigCopied1(dpy, screen, attribList, Buffers.SIZEOF_INT * attribList_offset, nitems, Buffers.SIZEOF_INT * nitems_offset); if (_res == null) return null; - return PointerBuffer.wrapNative2Java(_res, false); + return PointerBuffer.wrap(_res); } /** Entry point to C language function: - Alias for: <br> <code> GLXFBConfig * glXChooseFBConfigSGIX, glXChooseFBConfig(Display * dpy, int screen, const int * attribList, int * nitems); </code> */ @@ -35,7 +35,7 @@ if(attribList != null && attribList.length <= attribList_offset) throw new GLException("array offset argument \"attribList_offset\" (" + attribList_offset + ") equals or exceeds array length (" + attribList.length + ")"); java.nio.ByteBuffer _res; - _res = glXChooseVisualCopied1(dpy, screen, attribList, BufferFactory.SIZEOF_INT * attribList_offset); + _res = glXChooseVisualCopied1(dpy, screen, attribList, Buffers.SIZEOF_INT * attribList_offset); if (_res == null) return null; return XVisualInfo.create(_res); diff --git a/make/config/jogl/glx-x11.cfg b/make/config/jogl/glx-x11.cfg index c9079b84f..bbe805a04 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.sun.opengl.impl.x11.glx +Package com.jogamp.opengl.impl.x11.glx JavaClass GLX Style allstatic Include gl-common.cfg @@ -19,7 +19,7 @@ GetProcAddressTableExpr glxProcAddressTable # This must be present for bootstrapping SkipProcAddressGen glXGetProcAddressARB -Import com.sun.nativewindow.impl.x11.* +Import com.jogamp.nativewindow.impl.x11.* CustomJavaCode GLX private static GLXProcAddressTable glxProcAddressTable = new GLXProcAddressTable(); diff --git a/make/config/jogl/glxext.cfg b/make/config/jogl/glxext.cfg index 39ba379c4..1dfc8fccd 100755 --- 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.sun.opengl.impl.x11.glx +Package com.jogamp.opengl.impl.x11.glx Style InterfaceAndImpl JavaClass GLXExt -ImplPackage com.sun.opengl.impl.x11.glx +ImplPackage com.jogamp.opengl.impl.x11.glx ImplJavaClass GLXExtImpl -ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/com/sun/opengl/impl/x11/glx/GLX.java +ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/com/jogamp/opengl/impl/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.sun.nativewindow.impl.x11.* +Import com.jogamp.nativewindow.impl.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 6cd4fd412..2a69290a4 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.sun.opengl.impl.windows.wgl +Package com.jogamp.opengl.impl.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 ea9a0257e..35c43cb86 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.sun.opengl.impl.windows.wgl +Package com.jogamp.opengl.impl.windows.wgl Style InterfaceAndImpl JavaClass WGLExt -ImplPackage com.sun.opengl.impl.windows.wgl +ImplPackage com.jogamp.opengl.impl.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 dab377ad4..aad0ab261 100755 --- 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.sun.nativewindow.impl.jawt.windows.JAWT_Win32DrawingSurfaceInfo"); + factoryClass = Class.forName("com.jogamp.nativewindow.impl.jawt.windows.JAWT_Win32DrawingSurfaceInfo"); } else if (osName.startsWith("mac os x")) { - factoryClass = Class.forName("com.sun.nativewindow.impl.jawt.macosx.JAWT_MacOSXDrawingSurfaceInfo"); + factoryClass = Class.forName("com.jogamp.nativewindow.impl.jawt.macosx.JAWT_MacOSXDrawingSurfaceInfo"); } else { // Assume Linux, Solaris, etc. Should probably test for these explicitly. - factoryClass = Class.forName("com.sun.nativewindow.impl.jawt.x11.JAWT_X11DrawingSurfaceInfo"); + factoryClass = Class.forName("com.jogamp.nativewindow.impl.jawt.x11.JAWT_X11DrawingSurfaceInfo"); } platformInfoFactoryMethod = factoryClass.getMethod("create", new Class[] { ByteBuffer.class }); diff --git a/make/config/nativewindow/jawt-macosx.cfg b/make/config/nativewindow/jawt-macosx.cfg index b047ecdff..dea1a27b7 100644 --- a/make/config/nativewindow/jawt-macosx.cfg +++ b/make/config/nativewindow/jawt-macosx.cfg @@ -1,7 +1,7 @@ # This .cfg file is used to generate the interface to the JAWT, which # is used by the MacOSXOnscreenGLContext. Style AllStatic -Package com.sun.nativewindow.impl.jawt +Package com.jogamp.nativewindow.impl.jawt JavaClass JAWTFactory JavaOutputDir gensrc/classes NativeOutputDir gensrc/native/MacOSX @@ -22,8 +22,8 @@ CustomCCode #include <jawt.h> CustomCCode #include </usr/include/machine/types.h> import java.security.* -import com.sun.nativewindow.impl.jawt.* -StructPackage JAWT_MacOSXDrawingSurfaceInfo com.sun.nativewindow.impl.jawt.macosx +import com.jogamp.nativewindow.impl.jawt.* +StructPackage JAWT_MacOSXDrawingSurfaceInfo com.jogamp.nativewindow.impl.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 e7754843e..af0c7ce29 100644 --- a/make/config/nativewindow/jawt-win32.cfg +++ b/make/config/nativewindow/jawt-win32.cfg @@ -1,7 +1,7 @@ # This .cfg file is used to generate the interface to the JAWT, which # is used by the WindowsOnscreenGLContext. Style AllStatic -Package com.sun.nativewindow.impl.jawt +Package com.jogamp.nativewindow.impl.jawt JavaClass JAWTFactory JavaOutputDir gensrc/classes NativeOutputDir gensrc/native/Windows @@ -22,8 +22,8 @@ CustomCCode #include <jawt.h> Include ../intptr.cfg import java.security.* -import com.sun.nativewindow.impl.jawt.* -StructPackage JAWT_Win32DrawingSurfaceInfo com.sun.nativewindow.impl.jawt.windows +import com.jogamp.nativewindow.impl.jawt.* +StructPackage JAWT_Win32DrawingSurfaceInfo com.jogamp.nativewindow.impl.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 25df57a1f..ccfe009dd 100644 --- a/make/config/nativewindow/jawt-x11.cfg +++ b/make/config/nativewindow/jawt-x11.cfg @@ -1,7 +1,7 @@ # This .cfg file is used to generate the interface to the JAWT, which # is used by the X11OnscreenGLContext. Style AllStatic -Package com.sun.nativewindow.impl.jawt +Package com.jogamp.nativewindow.impl.jawt JavaClass JAWTFactory JavaOutputDir gensrc/classes NativeOutputDir gensrc/native/X11 @@ -22,8 +22,8 @@ CustomCCode #include <inttypes.h> CustomCCode #include <jawt.h> import java.security.* -import com.sun.nativewindow.impl.jawt.* -StructPackage JAWT_X11DrawingSurfaceInfo com.sun.nativewindow.impl.jawt.x11 +import com.jogamp.nativewindow.impl.jawt.* +StructPackage JAWT_X11DrawingSurfaceInfo com.jogamp.nativewindow.impl.jawt.x11 EmitStruct JAWT_X11DrawingSurfaceInfo Implements JAWT_X11DrawingSurfaceInfo JAWT_PlatformInfo diff --git a/make/config/nativewindow/x11-CustomCCode.c b/make/config/nativewindow/x11-CustomCCode.c deleted file mode 100755 index c1f66fee1..000000000 --- a/make/config/nativewindow/x11-CustomCCode.c +++ /dev/null @@ -1,169 +0,0 @@ -#include <inttypes.h> -#include <X11/Xlib.h> -#include <X11/Xutil.h> -/* Linux headers don't work properly */ -#define __USE_GNU -#include <dlfcn.h> -#undef __USE_GNU - -/* Current versions of Solaris don't expose the XF86 extensions, - although with the recent transition to Xorg this will probably - happen in an upcoming release */ -#if !defined(__sun) && !defined(_HPUX) -#include <X11/extensions/xf86vmode.h> -#else -/* Need to provide stubs for these */ -Bool XF86VidModeGetGammaRampSize( - Display *display, - int screen, - int* size) -{ - return False; -} - -Bool XF86VidModeGetGammaRamp( - Display *display, - int screen, - int size, - unsigned short *red_array, - unsigned short *green_array, - unsigned short *blue_array) { - return False; -} -Bool XF86VidModeSetGammaRamp( - Display *display, - int screen, - int size, - unsigned short *red_array, - unsigned short *green_array, - unsigned short *blue_array) { - return False; -} -#endif - -/* HP-UX doesn't define RTLD_DEFAULT. */ -#if defined(_HPUX) && !defined(RTLD_DEFAULT) -#define RTLD_DEFAULT NULL -#endif - -/* Need to expose DefaultScreen and RootWindow macros to Java */ -JNIEXPORT jlong JNICALL -Java_com_sun_nativewindow_impl_x11_X11Lib_DefaultScreen(JNIEnv *env, jclass _unused, jlong display) { - return DefaultScreen((Display*) (intptr_t) display); -} - -JNIEXPORT jlong JNICALL -Java_com_sun_nativewindow_impl_x11_X11Lib_DefaultVisualID(JNIEnv *env, jclass _unused, jlong display, jint screen) { - return (jlong) XVisualIDFromVisual( DefaultVisual( (Display*) (intptr_t) display, screen ) ); -} - -JNIEXPORT jlong JNICALL -Java_com_sun_nativewindow_impl_x11_X11Lib_RootWindow(JNIEnv *env, jclass _unused, jlong display, jint screen) { - return RootWindow((Display*) (intptr_t) display, screen); -} - -JNIEXPORT jlong JNICALL -Java_com_sun_nativewindow_impl_x11_X11Lib_dlopen(JNIEnv *env, jclass _unused, jstring name) { - const jbyte* chars; - void* res; - chars = (*env)->GetStringUTFChars(env, name, NULL); - res = dlopen(chars, RTLD_LAZY | RTLD_GLOBAL); - (*env)->ReleaseStringUTFChars(env, name, chars); - return (jlong) ((intptr_t) res); -} - -JNIEXPORT jlong JNICALL -Java_com_sun_nativewindow_impl_x11_X11Lib_dlsym(JNIEnv *env, jclass _unused, jstring name) { - const jbyte* chars; - void* res; - chars = (*env)->GetStringUTFChars(env, name, NULL); - res = dlsym(RTLD_DEFAULT, chars); - (*env)->ReleaseStringUTFChars(env, name, chars); - return (jlong) ((intptr_t) res); -} - -/* Need to pull this in as we don't have a stub header for it */ -extern Bool XineramaEnabled(Display* display); - -static const char * clazzNameInternalBufferUtil = "com/sun/nativewindow/impl/InternalBufferUtil"; -static const char * clazzNameInternalBufferUtilStaticCstrName = "copyByteBuffer"; -static const char * clazzNameInternalBufferUtilStaticCstrSignature = "(Ljava/nio/ByteBuffer;)Ljava/nio/ByteBuffer;"; -static const char * clazzNameByteBuffer = "java/nio/ByteBuffer"; -static jclass clazzInternalBufferUtil = NULL; -static jmethodID cstrInternalBufferUtil = NULL; -static jclass clazzByteBuffer = NULL; - -static void _initClazzAccess(JNIEnv *env) { - jclass c; - - if(NULL!=cstrInternalBufferUtil) return ; - - c = (*env)->FindClass(env, clazzNameInternalBufferUtil); - if(NULL==c) { - fprintf(stderr, "FatalError: Java_com_sun_nativewindow_impl_x11_X11Lib: can't find %s\n", clazzNameInternalBufferUtil); - (*env)->FatalError(env, clazzNameInternalBufferUtil); - } - clazzInternalBufferUtil = (jclass)(*env)->NewGlobalRef(env, c); - if(NULL==clazzInternalBufferUtil) { - fprintf(stderr, "FatalError: Java_com_sun_nativewindow_impl_x11_X11Lib: can't use %s\n", clazzNameInternalBufferUtil); - (*env)->FatalError(env, clazzNameInternalBufferUtil); - } - c = (*env)->FindClass(env, clazzNameByteBuffer); - if(NULL==c) { - fprintf(stderr, "FatalError: Java_com_sun_nativewindow_impl_x11_X11Lib: can't find %s\n", clazzNameByteBuffer); - (*env)->FatalError(env, clazzNameByteBuffer); - } - clazzByteBuffer = (jclass)(*env)->NewGlobalRef(env, c); - if(NULL==c) { - fprintf(stderr, "FatalError: Java_com_sun_nativewindow_impl_x11_X11Lib: can't use %s\n", clazzNameByteBuffer); - (*env)->FatalError(env, clazzNameByteBuffer); - } - - cstrInternalBufferUtil = (*env)->GetStaticMethodID(env, clazzInternalBufferUtil, - clazzNameInternalBufferUtilStaticCstrName, clazzNameInternalBufferUtilStaticCstrSignature); - if(NULL==cstrInternalBufferUtil) { - fprintf(stderr, "FatalError: Java_com_sun_nativewindow_impl_x11_X11Lib:: can't create %s.%s %s\n", - clazzNameInternalBufferUtil, - clazzNameInternalBufferUtilStaticCstrName, clazzNameInternalBufferUtilStaticCstrSignature); - (*env)->FatalError(env, clazzNameInternalBufferUtilStaticCstrName); - } -} - -/* Java->C glue code: - * Java package: com.sun.nativewindow.impl.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_sun_nativewindow_impl_x11_X11Lib_XGetVisualInfoCopied1__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; - int count; - jobject jbyteSource; - jobject jbyteCopy; - if (arg2 != NULL) { - _ptr2 = (XVisualInfo *) (((char*) (*env)->GetDirectBufferAddress(env, arg2)) + 0); - } - if (arg3 != NULL) { - _ptr3 = (int *) (((char*) (*env)->GetPrimitiveArrayCritical(env, arg3, NULL)) + arg3_byte_offset); - } - _res = XGetVisualInfo((Display *) (intptr_t) arg0, (long) arg1, (XVisualInfo *) _ptr2, (int *) _ptr3); - count = _ptr3[0]; - if (arg3 != NULL) { - (*env)->ReleasePrimitiveArrayCritical(env, arg3, _ptr3, 0); - } - if (_res == NULL) return NULL; - - _initClazzAccess(env); - - jbyteSource = (*env)->NewDirectByteBuffer(env, _res, count * sizeof(XVisualInfo)); - jbyteCopy = (*env)->CallStaticObjectMethod(env, - clazzInternalBufferUtil, cstrInternalBufferUtil, jbyteSource); - - // FIXME: remove reference/gc jbyteSource ?? - XFree(_res); - - return jbyteCopy; -} - diff --git a/make/config/nativewindow/x11-CustomJavaCode.java b/make/config/nativewindow/x11-CustomJavaCode.java index b1ee3a6c3..44bb1e8d0 100644 --- a/make/config/nativewindow/x11-CustomJavaCode.java +++ b/make/config/nativewindow/x11-CustomJavaCode.java @@ -5,10 +5,10 @@ if(arg3 != null && arg3.length <= arg3_offset) throw new RuntimeException("array offset argument \"arg3_offset\" (" + arg3_offset + ") equals or exceeds array length (" + arg3.length + ")"); java.nio.ByteBuffer _res; - _res = XGetVisualInfoCopied1(arg0, arg1, ((arg2 == null) ? null : arg2.getBuffer()), arg3, BufferFactory.SIZEOF_INT * arg3_offset); + _res = XGetVisualInfoCopied1(arg0, arg1, ((arg2 == null) ? null : arg2.getBuffer()), arg3, Buffers.SIZEOF_INT * arg3_offset); if (_res == null) return null; - BufferFactory.nativeOrder(_res); + Buffers.nativeOrder(_res); XVisualInfo[] _retarray = new XVisualInfo[getFirstElement(arg3, arg3_offset)]; for (int _count = 0; _count < getFirstElement(arg3, arg3_offset); _count++) { _res.position(_count * XVisualInfo.size()); @@ -24,3 +24,15 @@ /** Entry point to C language function: <code> XVisualInfo * XGetVisualInfo(Display * , long, XVisualInfo * , int * ); </code> */ private static native java.nio.ByteBuffer XGetVisualInfoCopied1(long arg0, long arg1, java.nio.ByteBuffer arg2, Object arg3, int arg3_byte_offset); + public static native long DefaultVisualID(long display, int screen); + + public static native long CreateDummyWindow(long display, int screen_index, long visualID); + public static native void DestroyDummyWindow(long display, long window); + + public static native long dlopen(String name); + public static native long dlsym(String name); + + public static native int XCloseDisplay(long display); + public static native void XUnlockDisplay(long display); + public static native void XLockDisplay(long display); + diff --git a/make/config/nativewindow/x11-lib.cfg b/make/config/nativewindow/x11-lib.cfg index 321444725..cf9642398 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.sun.nativewindow.impl.x11 +Package com.jogamp.nativewindow.impl.x11 JavaClass X11Lib Style allstatic @@ -20,24 +20,25 @@ Opaque long Display * Opaque boolean Bool Opaque long GLXFBConfig -CustomJavaCode X11Lib public static native long dlopen(String name); -CustomJavaCode X11Lib public static native long dlsym(String name); - IncludeAs CustomJavaCode X11Lib x11-CustomJavaCode.java -IncludeAs CustomCCode x11-CustomCCode.c +# Now resides in x11/Xmisc.c: IncludeAs CustomCCode x11-CustomCCode.c ArgumentIsString XOpenDisplay 0 -# Need to expose DefaultScreen and RootWindow macros to Java -CustomJavaCode X11Lib public static native int DefaultScreen(long display); -CustomJavaCode X11Lib public static native long DefaultVisualID(long display, int screen); -CustomJavaCode X11Lib public static native long RootWindow(long display, int screen); - # We have Custom code for the following Ignore XGetVisualInfo +ManuallyImplement XCloseDisplay +ManuallyImplement XUnlockDisplay +ManuallyImplement XLockDisplay + # Helper routine to make the ReturnedArrayLength expression below work correctly CustomJavaCode X11Lib private static int getFirstElement(IntBuffer buf) { return buf.get(buf.position()); } CustomJavaCode X11Lib private static int getFirstElement(int[] arr, int offset) { return arr[offset]; } CustomJavaCode XVisualInfo public static XVisualInfo create(XVisualInfo s) { XVisualInfo d = XVisualInfo.create(); d.getBuffer().put(s.getBuffer()); d.getBuffer().rewind(); s.getBuffer().rewind(); return d; } + +CustomCCode #include <inttypes.h> +CustomCCode #include <X11/Xlib.h> +CustomCCode #include <X11/Xutil.h> + diff --git a/make/java-run-newt.sh b/make/java-run-newt.sh new file mode 100755 index 000000000..384cf24c8 --- /dev/null +++ b/make/java-run-newt.sh @@ -0,0 +1,28 @@ +#! /bin/sh + +function print_usage() { + echo "Usage: $0 jogl-build-dir ..." +} + +if [ -z "$1" ] ; then + echo JOGL BUILD DIR missing + print_usage + exit +fi + +. ./setenv-jogl.sh $1 +shift + +MOSX=0 +uname -a | grep -i Darwin && MOSX=1 + +if [ $MOSX -eq 1 ] ; then + X_ARGS="-XstartOnFirstThread" +fi + +# D_ARGS="-Dgluegen.debug.ProcAddressHelper=true -Dgluegen.debug.NativeLibrary=true -Dnativewindow.debug=all -Djogl.debug=all -Dnewt.debug=all" +D_ARGS="-Dnativewindow.debug=all -Djogl.debug=all -Dnewt.debug=all -Djogl.debug.GLSLState" +# D_ARGS="-Dnativewindow.debug.X11Util=true -Djogl.debug.GLDrawableFactory=true" +# D_ARGS="-Dnativewindow.debug.X11Util=true" + +java $X_ARGS -Djava.awt.headless=true $D_ARGS com.jogamp.newt.util.MainThread $* 2>&1 | tee java-run-newt.log diff --git a/make/java-run.sh b/make/java-run.sh new file mode 100755 index 000000000..5e48cef3a --- /dev/null +++ b/make/java-run.sh @@ -0,0 +1,19 @@ +#! /bin/sh + +function print_usage() { + echo "Usage: $0 jogl-build-dir ..." +} + +if [ -z "$1" ] ; then + echo JOGL BUILD DIR missing + print_usage + exit +fi + +. ./setenv-jogl.sh $1 +shift + +MOSX=0 +uname -a | grep -i Darwin && MOSX=1 + +java $X_ARGS $* 2>&1 | tee java-run.log diff --git a/make/java-win32-dbg.bat b/make/java-win32-dbg.bat new file mode 100644 index 000000000..69287f8e9 --- /dev/null +++ b/make/java-win32-dbg.bat @@ -0,0 +1,16 @@ +
+set BLD_SUB=build-win32
+set J2RE_HOME=c:\jre1.6.0_19
+set JAVA_HOME=c:\jdk1.6.0_19
+set ANT_PATH=C:\apache-ant-1.8.0
+
+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-4.5.jar;%ANT_PATH%\lib\ant.jar;%ANT_PATH%\lib\ant-junit.jar
+
+echo CP_ALL %CP_ALL%
+
+%J2RE_HOME%\bin\java -classpath %CP_ALL% "-Djava.library.path=%LIB_DIR%" "-Dnativewindow.debug=all" "-Djogl.debug=all" "-Dnewt.debug=all" "-Dsun.java2d.noddraw=true" "-Dsun.awt.noerasebackground=true" %1 %2 %3 %4 %5 %6 %7 %8 %9 > java-win32-dbg.log 2>&1
diff --git a/make/java-win32.bat b/make/java-win32.bat new file mode 100644 index 000000000..5f731a14d --- /dev/null +++ b/make/java-win32.bat @@ -0,0 +1,16 @@ +
+set BLD_SUB=build-win32
+set J2RE_HOME=c:\jre1.6.0_19
+set JAVA_HOME=c:\jdk1.6.0_19
+set ANT_PATH=C:\apache-ant-1.8.0
+
+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-4.5.jar;%ANT_PATH%\lib\ant.jar;%ANT_PATH%\lib\ant-junit.jar
+
+echo CP_ALL %CP_ALL%
+
+%J2RE_HOME%\bin\java -classpath %CP_ALL% "-Djava.library.path=%LIB_DIR%" "-Dsun.java2d.noddraw=true" "-Dsun.awt.noerasebackground=true" %1 %2 %3 %4 %5 %6 %7 %8 %9 > java-win32.log 2>&1
diff --git a/make/jogl.properties b/make/jogl.properties index 4f5f4d44b..34a593dac 100644 --- a/make/jogl.properties +++ b/make/jogl.properties @@ -16,5 +16,5 @@ # default location, modify the appropriate variable to point to the # absolute path of the lib directory # -windows.cg.lib=C:/Program Files/Nvidia Corporation/Cg/lib +windows.cg.lib=C:/Cg-2.2/lib x11.cg.lib=/usr/lib diff --git a/make/joglversion b/make/joglversion index d013d0967..b65b6e3b6 100644 --- a/make/joglversion +++ b/make/joglversion @@ -3,6 +3,6 @@ Specification-Version: @BASEVERSION@ Specification-Vendor: Sun Microsystems, Inc. Implementation-Title: Java Bindings for OpenGL Runtime Environment Implementation-Version: @VERSION@ -Implementation-Vendor: java.net JOGL community +Implementation-Vendor: JogAmp community Extension-Name: javax.media.opengl -Implementation-Vendor-Id: com.sun +Implementation-Vendor-Id: com.jogamp diff --git a/make/joglversion-cdc b/make/joglversion-cdc index 5a2950b55..5056fbaf3 100644 --- a/make/joglversion-cdc +++ b/make/joglversion-cdc @@ -3,6 +3,6 @@ Specification-Version: @BASEVERSION@ Specification-Vendor: Sun Microsystems, Inc. Implementation-Title: Java Bindings for OpenGL Runtime Environment CDC Implementation-Version: @VERSION@ -Implementation-Vendor: java.net JOGL community +Implementation-Vendor: JogAmp community Extension-Name: javax.media.opengl -Implementation-Vendor-Id: com.sun +Implementation-Vendor-Id: com.jogamp diff --git a/make/lib/gluegen.compiler.intelgdl.xml b/make/lib/gluegen.compiler.intelgdl.xml index d0a1c50e2..9691a39d5 100644 --- a/make/lib/gluegen.compiler.intelgdl.xml +++ b/make/lib/gluegen.compiler.intelgdl.xml @@ -4,17 +4,18 @@ This is an example of how to add custom compiler/linker arguments for a crosscompiler and a custom NEWT windowing implementation. - You can use such files with setting the property 'gluegen.user.compiler.file', ie: + You can use such files with setting the property 'gluegen-cpptasks.file', ie: - -Dgluegen.user.compiler.file=`pwd`/lib/gluegen.compiler.intelgdl.xml + -Dgluegen-cpptasks.file=`pwd`/lib/gluegen.compiler.intelgdl.xml - or by having such file in your home directory, ie: - - ~/gluegen.compiler.xml --> <project name="GlueGen-cpptasks" basedir="."> + + <import file="../gluegen-cpptasks-base.xml" optional="false" /> + <target name="gluegen.cpptasks.configure.compiler" depends="setup.java.home.dir"> + <echo message="Custom forced linker.cfg.linux, linker.cfg.linux.amd64" /> <linker id="linker.cfg.linux" name="gcc"> <linkerarg value="-m32" /> <linkerarg value="-L/usr/lib" /> diff --git a/make/lstjars.sh b/make/lstjars.sh index 5357cde11..3837be5e3 100644 --- a/make/lstjars.sh +++ b/make/lstjars.sh @@ -1,17 +1,18 @@ #! /bin/sh THISDIR=$(pwd) -STATDIR=$THISDIR/../stats BUILDDIR=$1 shift BUILDDIR_GLUEGEN=$1 shift if [ -z "$BUILDDIR" -o -z "$BUILDDIR_GLUEGEN" ] ; then - echo "usage $0 <BUILDDIR-JOGL> <BUILDDIR-GLUEGEN>" + echo "usage $0 <BUILDDIR-JOGL> <BUILDDIR-GLUEGEN> [-skippack200]" exit 1 fi +STATDIR=$BUILDDIR-stats + skippack200=0 if [ "$1" = "-skippack200" ] ; then skippack200=1 @@ -23,6 +24,69 @@ function report() { du -ksc $* } +OSS=x11 +ARCH=linux-amd64 + +function listdeployment() { + JAR_SUFFIX=$1 + shift + + echo JOGL Deployment Payload for $JAR_SUFFIX + echo + + echo JOGL ES1 NEWT CORE + report gluegen-rt.$JAR_SUFFIX nativewindow.all-noawt.$JAR_SUFFIX jogl.core.$JAR_SUFFIX jogl.util.$JAR_SUFFIX jogl.egl.$JAR_SUFFIX jogl.gles1.$JAR_SUFFIX newt.all-noawt.$JAR_SUFFIX libgluegen-rt.so.gz libjogl_es1.so.gz libnewt.so.gz + echo + + echo JOGL ES2 NEWT CORE + report gluegen-rt.$JAR_SUFFIX nativewindow.all-noawt.$JAR_SUFFIX jogl.core.$JAR_SUFFIX jogl.util.$JAR_SUFFIX jogl.egl.$JAR_SUFFIX jogl.gles2.$JAR_SUFFIX newt.all-noawt.$JAR_SUFFIX libgluegen-rt.so.gz libjogl_es2.so.gz libnewt.so.gz + echo + + echo JOGL ES2 NEWT CORE FIXED + report gluegen-rt.$JAR_SUFFIX nativewindow.all-noawt.$JAR_SUFFIX jogl.core.$JAR_SUFFIX jogl.util.$JAR_SUFFIX jogl.egl.$JAR_SUFFIX jogl.gles2.$JAR_SUFFIX jogl.util.fixedfuncemu.$JAR_SUFFIX newt.all-noawt.$JAR_SUFFIX libgluegen-rt.so.gz libjogl_es2.so.gz libnewt.so.gz + echo + + echo JOGL GL2ES12 NEWT + report gluegen-rt.$JAR_SUFFIX nativewindow.all-noawt.$JAR_SUFFIX jogl.core.$JAR_SUFFIX jogl.util.$JAR_SUFFIX jogl.os.$OSS.$JAR_SUFFIX jogl.gl2es12.$JAR_SUFFIX newt.all-noawt.$JAR_SUFFIX libgluegen-rt.so.gz libjogl_gl2es12.so.gz libnewt.so.gz libnativewindow_$OSS.so.gz + echo + + echo JOGL GL2 NEWT + report gluegen-rt.$JAR_SUFFIX nativewindow.all-noawt.$JAR_SUFFIX jogl.core.$JAR_SUFFIX jogl.util.$JAR_SUFFIX jogl.os.$OSS.$JAR_SUFFIX jogl.gldesktop.$JAR_SUFFIX newt.all-noawt.$JAR_SUFFIX libgluegen-rt.so.gz libjogl_desktop.so.gz libnewt.so.gz libnativewindow_$OSS.so.gz + echo + + echo JOGL GL2 AWT + report gluegen-rt.$JAR_SUFFIX nativewindow.all.$JAR_SUFFIX jogl.core.$JAR_SUFFIX jogl.util.$JAR_SUFFIX jogl.os.$OSS.$JAR_SUFFIX jogl.gldesktop.$JAR_SUFFIX jogl.awt.$JAR_SUFFIX libgluegen-rt.so.gz libjogl_desktop.so.gz libnativewindow_$OSS.so.gz libnativewindow_awt.so.gz + echo + + echo JOGL ALL AWT + report gluegen-rt.$JAR_SUFFIX nativewindow.all.$JAR_SUFFIX jogl.all.$JAR_SUFFIX libgluegen-rt.so.gz libjogl_desktop.so.gz libnativewindow_$OSS.so.gz libnativewindow_awt.so.gz + echo + + echo JOGL ALL No AWT + 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 + + echo JOGL EVERYTHING + report *.all.$JAR_SUFFIX libgluegen-rt.so.gz libnativewindow_$OSS.so.gz libnativewindow_awt.so.gz libjogl_desktop.so.gz libjogl_es1.so.gz libjogl_es2.so.gz libnewt.so.gz + echo +} + rm -rf $STATDIR mkdir -p $STATDIR cp -a $BUILDDIR/nativewindow/obj/*.so $STATDIR @@ -59,24 +123,26 @@ done rm -rf nope mkdir -p nope -mv *.cdc.lst *.all.lst nope/ +mv *.cdc.lst *.all*.lst nope/ -mv jogl.gl2es12.*.lst jogl.gl2.*.lst nope/ -echo duplicates - w/o gl2es12.* gl2.* +mv jogl.gl2es12.*.lst jogl.gldesktop.*.lst nope/ +echo duplicates - w/o gl2es12.* gldesktop.* echo sort jogl*.lst | uniq -d mv nope/* . -mv *.cdc.lst *.all.lst nope/ +mv *.cdc.lst *.all*.lst nope/ cat *.lst | sort -u > allparts.lst mv nope/* . -cat *.all.lst | sort -u > allall.lst +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 diff -Nur allparts.lst allall.lst +listdeployment jar + if [ $skippack200 -eq 0 ] ; then for i in *.jar ; do fname=$i @@ -84,57 +150,6 @@ if [ $skippack200 -eq 0 ] ; then echo pack200 $bname.pack.gz $fname pack200 $bname.pack.gz $fname done - JAR_SUFFIX=pack.gz -else - JAR_SUFFIX=jar + listdeployment pack.gz fi -OSS=x11 - -echo JOGL ES1 NEWT CORE -report gluegen-rt.$JAR_SUFFIX nativewindow.core.$JAR_SUFFIX jogl.core.$JAR_SUFFIX jogl.util.$JAR_SUFFIX jogl.egl.$JAR_SUFFIX jogl.gles1.$JAR_SUFFIX newt.core.$JAR_SUFFIX newt.ogl.$JAR_SUFFIX libgluegen-rt.so.gz libnativewindow_jvm.so.gz libjogl_es1.so.gz libnewt.so.gz -echo - -echo JOGL ES2 NEWT CORE -report gluegen-rt.$JAR_SUFFIX nativewindow.core.$JAR_SUFFIX jogl.core.$JAR_SUFFIX jogl.util.$JAR_SUFFIX jogl.egl.$JAR_SUFFIX jogl.gles2.$JAR_SUFFIX newt.core.$JAR_SUFFIX newt.ogl.$JAR_SUFFIX libgluegen-rt.so.gz libnativewindow_jvm.so.gz libjogl_es2.so.gz libnewt.so.gz -echo - -echo JOGL ES2 NEWT CORE FIXED -report gluegen-rt.$JAR_SUFFIX nativewindow.core.$JAR_SUFFIX jogl.core.$JAR_SUFFIX jogl.util.$JAR_SUFFIX jogl.egl.$JAR_SUFFIX jogl.gles2.$JAR_SUFFIX jogl.util.fixedfuncemu.$JAR_SUFFIX newt.core.$JAR_SUFFIX newt.ogl.$JAR_SUFFIX libgluegen-rt.so.gz libnativewindow_jvm.so.gz libjogl_es2.so.gz libnewt.so.gz -echo - -echo JOGL GL2ES12 NEWT -report gluegen-rt.$JAR_SUFFIX nativewindow.core.$JAR_SUFFIX jogl.core.$JAR_SUFFIX jogl.util.$JAR_SUFFIX jogl.gl2es12.$OSS.$JAR_SUFFIX newt.core.$JAR_SUFFIX newt.ogl.$JAR_SUFFIX libgluegen-rt.so.gz libjogl_gl2es12.so.gz libnewt.so.gz libnativewindow_$OSS.so.gz libnativewindow_jvm.so.gz -echo - -echo JOGL GL2 NEWT -report gluegen-rt.$JAR_SUFFIX nativewindow.core.$JAR_SUFFIX jogl.core.$JAR_SUFFIX jogl.util.$JAR_SUFFIX jogl.gl2.$OSS.$JAR_SUFFIX newt.core.$JAR_SUFFIX newt.ogl.$JAR_SUFFIX libgluegen-rt.so.gz libjogl_gl2.so.gz libnewt.so.gz libnativewindow_$OSS.so.gz libnativewindow_jvm.so.gz -echo - -echo JOGL GL2 AWT -report gluegen-rt.$JAR_SUFFIX nativewindow.core.$JAR_SUFFIX nativewindow.awt.$JAR_SUFFIX jogl.core.$JAR_SUFFIX jogl.util.$JAR_SUFFIX jogl.gl2.$OSS.$JAR_SUFFIX jogl.awt.$JAR_SUFFIX libgluegen-rt.so.gz libjogl_gl2.so.gz libnativewindow_$OSS.so.gz libnativewindow_awt.so.gz libnativewindow_jvm.so.gz -echo - -echo JOGL ALL -report gluegen-rt.$JAR_SUFFIX nativewindow.all.$JAR_SUFFIX jogl.all.$JAR_SUFFIX newt.all.$JAR_SUFFIX libgluegen-rt.so.gz libjogl_gl2.so.gz libnativewindow_$OSS.so.gz libnativewindow_awt.so.gz libnativewindow_jvm.so.gz libnewt.so.gz -echo - -echo JOGL CDCFP DESKTOP -report gluegen-rt-cdc.$JAR_SUFFIX nativewindow.core.$JAR_SUFFIX jogl.all.cdc.$JAR_SUFFIX newt.all.cdc.$JAR_SUFFIX libgluegen-rt.so.gz libjogl_gl2es12.so.gz libnativewindow_$OSS.so.gz libnativewindow_jvm.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.core.cdc.$JAR_SUFFIX newt.broadcomegl.cdc.$JAR_SUFFIX newt.core.cdc.$JAR_SUFFIX newt.ogl.cdc.$JAR_SUFFIX libgluegen-rt.so.gz libjogl_es1.so.gz libnativewindow_jvm.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.core.cdc.$JAR_SUFFIX newt.broadcomegl.cdc.$JAR_SUFFIX newt.core.cdc.$JAR_SUFFIX newt.ogl.cdc.$JAR_SUFFIX libgluegen-rt.so.gz libjogl_es2.so.gz libnativewindow_jvm.so.gz libnewt.so.gz -echo - -echo JOGL GLU -report jogl.glu.*pack.gz -echo - -echo JOGL EVERYTHING -report *.all.pack.gz -echo diff --git a/make/make.jogl.all.linux-x86.sh b/make/make.jogl.all.linux-x86.sh index 081d8328b..32f48a80f 100644 --- a/make/make.jogl.all.linux-x86.sh +++ b/make/make.jogl.all.linux-x86.sh @@ -17,6 +17,7 @@ fi # -Djogl.cg=1 -Dx11.cg.lib=../../lib-linux-x86 \ ant \ + -Dgluegen-cpptasks.file=`pwd`/../../gluegen/make/lib/gluegen-cpptasks-linux-32bit.xml \ -Dbuild.noarchives=true \ -Djogl.cg=1 -Dx11.cg.lib=../../lib-linux-x86 \ -Drootrel.build=build-x86 \ diff --git a/make/make.jogl.all.linux-x86_64.sh b/make/make.jogl.all.linux-x86_64.sh index b5f860bd4..b6c5e9d63 100644 --- a/make/make.jogl.all.linux-x86_64.sh +++ b/make/make.jogl.all.linux-x86_64.sh @@ -5,8 +5,8 @@ if [ -e ../../setenv-build-jogl-x86_64.sh ] ; then fi # -Djogl.cg=1 -Dx11.cg.lib=../../lib-linux-x86_64 -# -Dc.compiler.debug=true -# -Dbuild.noarchives=true +# -Dc.compiler.debug=true \ +# -Dbuild.noarchives=true \ # -Dgluegen.cpptasks.detected.os=true \ # -DisUnix=true \ @@ -18,7 +18,6 @@ fi ant \ -Dbuild.noarchives=true \ -Djogl.cg=1 -Dx11.cg.lib=../../lib-linux-x86_64 \ - -Dc.compiler.debug=true \ -Drootrel.build=build-x86_64 \ -DuseKD=true \ -DuseOpenMAX=true \ diff --git a/make/make.jogl.all.win32.bat b/make/make.jogl.all.win32.bat index 8525b5a45..fe6a8aff0 100644 --- a/make/make.jogl.all.win32.bat +++ b/make/make.jogl.all.win32.bat @@ -1,12 +1,17 @@ -set THISDIR="C:\SUN\JOGL2"
-set J2RE_HOME=c:\jre6
-set JAVA_HOME=c:\jdk6
-set PATH=%JAVA_HOME%\bin;%PATH%
+set THISDIR="C:\JOGL"
+
+set J2RE_HOME=c:\jre1.6.0_19
+set JAVA_HOME=c:\jdk1.6.0_19
+set ANT_PATH=C:\apache-ant-1.8.0
+
+set PATH=%JAVA_HOME%\bin;%ANT_PATH%\bin;c:\mingw\bin;%PATH%
+
set LIB_GEN=%THISDIR%\lib
set CLASSPATH=.;%THISDIR%\build-win32\classes
REM -Dc.compiler.debug=true
REM -DuseOpenMAX=true
REM -DuseKD=true
REM -Djogl.cg=1 -D-Dwindows.cg.lib=C:\Cg-2.2
+REM -Dbuild.noarchives=true
-ant -Dbuild.noarchives=true -Dc.compiler.debug=true -Drootrel.build=build-win32 -Djogl.cg=1 -Dwindows.cg.lib=C:\Cg-2.2\lib %1 %2 %3 %4 %5 %6 %7 %8 %9 > make.jogl.all.win32.log 2>&1
+ant -Drootrel.build=build-win32 -Djogl.cg=1 -Dwindows.cg.lib=C:\Cg-2.2\lib %1 %2 %3 %4 %5 %6 %7 %8 %9 > make.jogl.all.win32.log 2>&1
diff --git a/make/make.jogl.all.win64.bat b/make/make.jogl.all.win64.bat new file mode 100644 index 000000000..508067d57 --- /dev/null +++ b/make/make.jogl.all.win64.bat @@ -0,0 +1,17 @@ +set THISDIR="C:\JOGL"
+
+set J2RE_HOME=c:\jre1.6.0_19
+set JAVA_HOME=c:\jdk1.6.0_19
+set ANT_PATH=C:\apache-ant-1.8.0
+
+set PATH=%JAVA_HOME%\bin;%ANT_PATH%\bin;c:\mingw-w64\bin;c:\mingw\bin;%PATH%
+
+set LIB_GEN=%THISDIR%\lib
+set CLASSPATH=.;%THISDIR%\build-win64\classes
+REM -Dc.compiler.debug=true
+REM -DuseOpenMAX=true
+REM -DuseKD=true
+REM -Djogl.cg=1 -D-Dwindows.cg.lib=C:\Cg-2.2
+REM -Dbuild.noarchives=true
+
+ant -Drootrel.build=build-win64 -Djogl.cg=1 -Dwindows.cg.lib=C:\Cg-2.2\lib %1 %2 %3 %4 %5 %6 %7 %8 %9 > make.jogl.all.win64.log 2>&1
diff --git a/make/make.jogl.cdcfp.linux-x86.sh b/make/make.jogl.cdcfp.linux-x86.sh index 4a2241669..ad80f194d 100644 --- a/make/make.jogl.cdcfp.linux-x86.sh +++ b/make/make.jogl.cdcfp.linux-x86.sh @@ -15,6 +15,7 @@ fi 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 \ diff --git a/make/newtRIversion b/make/newtRIversion index 7b8608290..82cc0c0e9 100644 --- a/make/newtRIversion +++ b/make/newtRIversion @@ -4,5 +4,5 @@ Specification-Vendor: Sun Microsystems, Inc. Implementation-Title: NEWT Runtime Environment Implementation-Version: @BASEVERSION@ Implementation-Vendor: Sun Microsystems, Inc. -Extension-Name: com.sun.javafx.newt +Extension-Name: com.sun.newt Implementation-Vendor-Id: com.sun diff --git a/make/newtRIversion-cdc b/make/newtRIversion-cdc index 0dd17ee93..5dcfecad8 100644 --- a/make/newtRIversion-cdc +++ b/make/newtRIversion-cdc @@ -4,5 +4,5 @@ Specification-Vendor: Sun Microsystems, Inc. Implementation-Title: NEWT Runtime Environment CDC Implementation-Version: @BASEVERSION@ Implementation-Vendor: Sun Microsystems, Inc. -Extension-Name: com.sun.javafx.newt +Extension-Name: com.sun.newt Implementation-Vendor-Id: com.sun diff --git a/make/newtversion b/make/newtversion index 3c9335cf5..d1734f756 100644 --- a/make/newtversion +++ b/make/newtversion @@ -4,5 +4,5 @@ Specification-Vendor: Sun Microsystems, Inc. Implementation-Title: NEWT Runtime Environment Implementation-Version: @VERSION@ Implementation-Vendor: java.net JOGL community -Extension-Name: com.sun.javafx.newt +Extension-Name: com.sun.newt Implementation-Vendor-Id: com.sun diff --git a/make/newtversion-cdc b/make/newtversion-cdc index 624111760..8227a4d42 100644 --- a/make/newtversion-cdc +++ b/make/newtversion-cdc @@ -4,5 +4,5 @@ Specification-Vendor: Sun Microsystems, Inc. Implementation-Title: NEWT Runtime Environment CDC Implementation-Version: @VERSION@ Implementation-Vendor: java.net JOGL community -Extension-Name: com.sun.javafx.newt +Extension-Name: com.sun.newt Implementation-Vendor-Id: com.sun diff --git a/make/scripts/all-deploy-webstarttest.sh b/make/scripts/all-deploy-webstarttest.sh new file mode 100755 index 000000000..e3ee24a6d --- /dev/null +++ b/make/scripts/all-deploy-webstarttest.sh @@ -0,0 +1,38 @@ +#! /bin/sh + +if [ ! -e scripts -o ! -e ../make ] ; then + echo start this script from JOGL/jogl/make + exit 1 +fi + +url=$1 +shift + +joglbuilddir=$1 +shift + +wsdir=$1 +shift + +if [ -z "$url" -o -z "$joglbuilddir" -o -z "$wsdir" ] ; then + echo Usage $0 codebase-url jogl-builddir webstartdir + echo Examples + echo sh $0 file:////usr/local/projects/JOGL/webstart ../build-x86_64 ../../webstart + echo sh $0 http://domain.org/jogl/webstart ../build-win32 ../../webstart + exit 1 +fi + +if [ ! -e $joglbuilddir ] ; then + echo $joglbuilddir does not exist + exit 1 +fi + +if [ ! -e $wsdir ] ; then + echo $wsdir does not exist + exit 1 +fi + +sh scripts/deploy-jars-webstarttest.sh $joglbuilddir $wsdir +# sh scripts/deploy-jars-webstarttest_pack200.sh $wsdir +sh scripts/deploy-jnlp-webstarttest.sh $url $joglbuilddir $wsdir +sh scripts/deploy-jnlp-webstarttest-filter.sh $wsdir diff --git a/make/scripts/deploy-jars_external-webstarttest.sh b/make/scripts/deploy-jars_external-webstarttest.sh new file mode 100755 index 000000000..3fc1daa51 --- /dev/null +++ b/make/scripts/deploy-jars_external-webstarttest.sh @@ -0,0 +1,26 @@ +#! /bin/sh + +if [ ! -e scripts -o ! -e ../make ] ; then + echo start this script from JOGL/jogl/make + exit 1 +fi + +SOURCE=$1 +shift + +wsdir=$1 +shift + +if [ -z "$SOURCE" -o -z "$wsdir" ] ; then + echo usage $0 source webstartdir + echo source might be [email protected]:webstart/ + exit 1 +fi + +if [ ! -e $wsdir ] ; then + echo $wsdir does not exist + exit 1 +fi + +echo scp -v $SOURCE*natives* $wsdir +scp -v $SOURCE*natives* $wsdir diff --git a/make/scripts/deploy-jnlp-webstarttest.sh b/make/scripts/deploy-jnlp-webstarttest.sh index 26a0f8b35..8f3b0d216 100755 --- a/make/scripts/deploy-jnlp-webstarttest.sh +++ b/make/scripts/deploy-jnlp-webstarttest.sh @@ -11,6 +11,9 @@ shift if [ -z "$url" -o -z "$joglbuilddir" -o -z "$wsdir" ] ; then echo usage $0 codebase-url jogl-builddir webstartdir + echo Examples + echo sh $0 file:////usr/local/projects/JOGL/webstart ../build-x86_64 ../../webstart + echo sh $0 http://domain.org/jogl/webstart ../build-win32 ../../webstart exit 1 fi diff --git a/make/setenv-jogl.sh b/make/setenv-jogl.sh new file mode 100644 index 000000000..49c584459 --- /dev/null +++ b/make/setenv-jogl.sh @@ -0,0 +1,92 @@ +#! /bin/sh + +function print_usage() { + echo "Usage: $0 jogl-build-dir" +} + +if [ -z "$1" ] ; then + echo JOGL BUILD DIR missing + print_usage + return +fi + +if [ -e /devtools/etc/profile.ant ] ; then + . /devtools/etc/profile.ant +fi + +JOGL_PROFILE=JOGL_ALL + +JOGL_BUILDDIR=$1 +shift + +THISDIR=`pwd` + +if [ -e "$JOGL_BUILDDIR" ] ; then + JOGL_DIR=$JOGL_BUILDDIR/.. + JOGL_BUILDDIR_BASE=`basename $JOGL_BUILDDIR` +else + echo JOGL_BUILDDIR $JOGL_BUILDDIR not exist or not given + print_usage + return +fi + +gpf=`find ../../gluegen/make -name dynlink-unix.cfg` +if [ -z "$gpf" ] ; then + gpf=`find .. -name dynlink-unix.cfg` +fi +if [ -z "$gpf" ] ; then + echo GLUEGEN_BUILDDIR not found + print_usage + return +fi + +GLUEGEN_DIR=`dirname $gpf`/.. +GLUEGEN_BUILDDIR=$GLUEGEN_DIR/$JOGL_BUILDDIR_BASE +if [ ! -e "$GLUEGEN_BUILDDIR" ] ; then + echo GLUEGEN_BUILDDIR $GLUEGEN_BUILDDIR does not exist + print_usage + return +fi +GLUEGEN_JAR=$GLUEGEN_BUILDDIR/gluegen-rt.jar +GLUEGEN_OS=$GLUEGEN_BUILDDIR/obj +JUNIT_JAR=$GLUEGEN_DIR/make/lib/junit-4.5.jar + +if [ -z "$ANT_PATH" ] ; then + echo ANT_PATH does not exist, set it + print_usage + return +else + ANT_JARS=$ANT_PATH/lib/ant.jar:$ANT_PATH/lib/ant-junit.jar +fi + +echo GLUEGEN BUILDDIR: $GLUEGEN_BUILDDIR +echo JOGL DIR: $JOGL_DIR +echo JOGL BUILDDIR: $JOGL_BUILDDIR +echo JOGL BUILDDIR BASE: $JOGL_BUILDDIR_BASE +echo JOGL PROFILE: $JOGL_PROFILE + +J2RE_HOME=$(which java) +JAVA_HOME=$(which javac) +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 +for i in $LIB/*jar ; do + CLASSPATH=$CLASSPATH:$i +done +export CLASSPATH +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$GLUEGEN_OS:$JOGL_LIB_DIR +export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$GLUEGEN_OS:$JOGL_LIB_DIR + +echo CLASSPATH: $CLASSPATH +echo +echo MacOSX REMEMBER to add the JVM arguments "-XstartOnFirstThread -Djava.awt.headless=true" for running demos without AWT, e.g. NEWT +echo MacOSX REMEMBER to add the JVM arguments "-XstartOnFirstThread -Djava.awt.headless=true com.jogamp.newt.util.MainThread" for running demos with NEWT + +PATH=$J2RE_HOME/bin:$JAVA_HOME/bin:$PATH +export PATH + diff --git a/make/setvc9-jogl.bat b/make/setvc9-jogl.bat index be6f039ad..2e8338374 100755 --- a/make/setvc9-jogl.bat +++ b/make/setvc9-jogl.bat @@ -1,7 +1,7 @@ -set PATH=C:\cygwin\devtools\share\apache-ant-1.7.0\bin;%PATH%
-set ANT_PATH=C:\cygwin\devtools\share\apache-ant-1.7.0
+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
c:
cd C:\SUN\JOGL2\jogl\make
diff --git a/make/stub_includes/egl/EGL/egl.h b/make/stub_includes/egl/EGL/egl.h index fc6cc4c87..a384bab48 100755 --- a/make/stub_includes/egl/EGL/egl.h +++ b/make/stub_includes/egl/EGL/egl.h @@ -20,13 +20,7 @@ extern "C" { typedef int32_t EGLint; typedef unsigned int EGLBoolean; typedef unsigned int EGLenum; -#ifdef USE_GLUEGEN - /* GlueGen currently needs this form of typedef to produce distinct - types for each of these pointer types */ - typedef struct {} _EGLConfig, *EGLConfig; -#else - typedef void *EGLConfig; -#endif +typedef void *EGLConfig; typedef void *EGLContext; typedef void *EGLDisplay; typedef void *EGLSurface; diff --git a/make/stub_includes/opengl/gl3-64bit-types.h b/make/stub_includes/opengl/gl3-64bit-types.h index fc8b4ce05..64f12398a 100644 --- a/make/stub_includes/opengl/gl3-64bit-types.h +++ b/make/stub_includes/opengl/gl3-64bit-types.h @@ -25,12 +25,14 @@ #include <stdint.h> #elif defined(__UNIXOS2__) || defined(__SOL64__) typedef long int int32_t; + typedef unsigned long int uint32_t; typedef long long int int64_t; typedef unsigned long long int uint64_t; #elif defined(WIN32) && defined(__GNUC__) #include <stdint.h> #elif defined(_WIN32) typedef __int32 int32_t; + typedef unsigned __int32 uint32_t; typedef __int64 int64_t; typedef unsigned __int64 uint64_t; #else diff --git a/make/stub_includes/opengl/gl4.c b/make/stub_includes/opengl/gl4.c new file mode 100644 index 000000000..5e9d87ccd --- /dev/null +++ b/make/stub_includes/opengl/gl4.c @@ -0,0 +1,11 @@ +#define GLAPI + +// Define GL3_PROTOTYPES so that the OpenGL prototypes in +// "gl3.h" are parsed. +#define GL3_PROTOTYPES + +// Define GL_GL3EXT_PROTOTYPES so that the OpenGL extension prototypes in +// "gl3ext.h" are parsed. +#define GL_GL3EXT_PROTOTYPES + +#include <GL3/gl3.h> diff --git a/make/stub_includes/opengl/gl4bc.c b/make/stub_includes/opengl/gl4bc.c new file mode 100644 index 000000000..262e005f7 --- /dev/null +++ b/make/stub_includes/opengl/gl4bc.c @@ -0,0 +1,18 @@ +#define GLAPI + +// Define GL_GLEXT_PROTOTYPES so that the OpenGL extension prototypes in +// "glext.h" are parsed. +#define GL_GLEXT_PROTOTYPES + +#include <GL/gl.h> + +// Define GL3_PROTOTYPES so that the OpenGL prototypes in +// "gl3.h" are parsed. +#define GL3_PROTOTYPES + +// Define GL_GL3EXT_PROTOTYPES so that the OpenGL extension prototypes in +// "gl3ext.h" are parsed. +#define GL_GL3EXT_PROTOTYPES + +#include <GL3/gl3ext.h> + diff --git a/make/stub_includes/win32/wingdi.h b/make/stub_includes/win32/wingdi.h index 46aeec2b6..fbf2ec5ec 100644 --- a/make/stub_includes/win32/wingdi.h +++ b/make/stub_includes/win32/wingdi.h @@ -212,7 +212,7 @@ 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 -HDC CreateDummyWindow(int,int,int,int); +HWND CreateDummyWindow( int x, int y, int width, int height ) ; WINUSERAPI BOOL WINAPI ShowWindow(HWND hWnd, int nCmdShow); WINUSERAPI HDC WINAPI GetDC(HWND); WINUSERAPI int WINAPI ReleaseDC(HWND hWnd, HDC hDC); diff --git a/make/stub_includes/x11/window-lib.c b/make/stub_includes/x11/window-lib.c index 3096cde4c..8fca86263 100644 --- a/make/stub_includes/x11/window-lib.c +++ b/make/stub_includes/x11/window-lib.c @@ -17,6 +17,9 @@ extern void XLockDisplay(Display *display); extern void XUnlockDisplay(Display *display); +extern Window RootWindow(Display *display, int screen_number); +extern int DefaultScreen(Display *display); + extern XVisualInfo *XGetVisualInfo( Display* /* display */, long /* vinfo_mask */, diff --git a/make/versions.xml b/make/versions.xml index 0ee07bfe0..75c035f5a 100644 --- a/make/versions.xml +++ b/make/versions.xml @@ -19,7 +19,6 @@ official release builds and intermediate release builds, but commented out for nightly builds. --> <!-- <property name="jogl.ri" value="true" /> --> - <property name="jogl.ri" value="true" /> <!-- Base version of the NativeWindow interface, following the same rules as above --> @@ -31,7 +30,6 @@ official release builds and intermediate release builds, but commented out for nightly builds. --> <!-- <property name="nativewindow.ri" value="true" /> --> - <property name="nativewindow.ri" value="true" /> <!-- Base version of the Newt library, following the same rules as above --> @@ -44,6 +42,5 @@ official release builds and intermediate release builds, but commented out for nightly builds. --> <!-- <property name="newt.ri" value="true" /> --> - <property name="newt.ri" value="true" /> </project> diff --git a/nativewindow.iml b/nativewindow.iml new file mode 100644 index 000000000..8e058bffe --- /dev/null +++ b/nativewindow.iml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="UTF-8"?> +<module type="JAVA_MODULE" version="4"> + <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"> + <sourceFolder url="file://$MODULE_DIR$/src/nativewindow/classes" isTestSource="false" /> + </content> + <orderEntry type="inheritedJdk" /> + <orderEntry type="sourceFolder" forTests="false" /> + <orderEntry type="module" module-name="gluegen" /> + <orderEntry type="library" name="junit" level="application" /> + </component> +</module> + diff --git a/nbproject/project.xml b/nbproject/project.xml index 0c128d1f1..f1a94a2a5 100755 --- a/nbproject/project.xml +++ b/nbproject/project.xml @@ -47,6 +47,12 @@ <location>src/nativewindow/classes</location> <encoding>UTF-8</encoding> </source-folder> + <source-folder> + <label>src/junit</label> + <type>java</type> + <location>src/junit</location> + <encoding>UTF-8</encoding> + </source-folder> </folders> <ide-actions> <action name="build"> @@ -75,6 +81,14 @@ </arity> </context> </action> + <action name="test"> + <script>${ant.script}</script> + <target>junit.run</target> + </action> + <action name="javadoc"> + <script>${ant.script}</script> + <target>javadoc</target> + </action> </ide-actions> <export> <type>folder</type> @@ -104,6 +118,10 @@ <label>nativewindow</label> <location>src/nativewindow/classes</location> </source-folder> + <source-folder style="packages"> + <label>src/junit</label> + <location>src/junit</location> + </source-folder> <source-file> <location>${ant.script}</location> </source-file> @@ -112,6 +130,8 @@ <ide-action name="build"/> <ide-action name="rebuild"/> <ide-action name="clean"/> + <ide-action name="javadoc"/> + <ide-action name="test"/> </context-menu> </view> <subprojects/> @@ -120,12 +140,13 @@ <compilation-unit> <package-root>src/newt/classes</package-root> <package-root>src/jogl/classes</package-root> - <package-root>build/jogl/gensrc/classes</package-root> <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</classpath> + <package-root>src/junit</package-root> + <classpath mode="compile">../gluegen/build/gluegen-rt.jar:../gluegen/make/lib/junit-4.5.jar</classpath> <built-to>bin</built-to> - <source-level>1.4</source-level> + <source-level>1.5</source-level> </compilation-unit> </java-data> </configuration> diff --git a/newt.iml b/newt.iml new file mode 100644 index 000000000..cfaabf195 --- /dev/null +++ b/newt.iml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8"?> +<module type="JAVA_MODULE" version="4"> + <component name="NewModuleRootManager" inherit-compiler-output="true"> + <exclude-output /> + <content url="file://$MODULE_DIR$/src/newt"> + <sourceFolder url="file://$MODULE_DIR$/src/newt/classes" isTestSource="false" /> + </content> + <orderEntry type="inheritedJdk" /> + <orderEntry type="sourceFolder" forTests="false" /> + <orderEntry type="module" module-name="nativewindow" /> + <orderEntry type="module" module-name="gluegen" /> + <orderEntry type="library" name="junit" level="application" /> + </component> +</module> + diff --git a/src/jogl/classes/com/sun/javafx/audio/windows/waveout/Audio.java b/src/jogl/classes/com/jogamp/audio/windows/waveout/Audio.java index 8e4e97b0c..2b51be164 100755 --- a/src/jogl/classes/com/sun/javafx/audio/windows/waveout/Audio.java +++ b/src/jogl/classes/com/jogamp/audio/windows/waveout/Audio.java @@ -30,7 +30,7 @@ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ -package com.sun.javafx.audio.windows.waveout; +package com.jogamp.audio.windows.waveout; import java.io.*; diff --git a/src/jogl/classes/com/sun/javafx/audio/windows/waveout/Mixer.java b/src/jogl/classes/com/jogamp/audio/windows/waveout/Mixer.java index 814a74a8c..60972873e 100755 --- a/src/jogl/classes/com/sun/javafx/audio/windows/waveout/Mixer.java +++ b/src/jogl/classes/com/jogamp/audio/windows/waveout/Mixer.java @@ -30,7 +30,7 @@ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ -package com.sun.javafx.audio.windows.waveout; +package com.jogamp.audio.windows.waveout; import java.io.*; import java.nio.*; diff --git a/src/jogl/classes/com/sun/javafx/audio/windows/waveout/SoundBuffer.java b/src/jogl/classes/com/jogamp/audio/windows/waveout/SoundBuffer.java index b0404673e..c45430d23 100755 --- a/src/jogl/classes/com/sun/javafx/audio/windows/waveout/SoundBuffer.java +++ b/src/jogl/classes/com/jogamp/audio/windows/waveout/SoundBuffer.java @@ -30,7 +30,7 @@ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ -package com.sun.javafx.audio.windows.waveout; +package com.jogamp.audio.windows.waveout; import java.io.*; diff --git a/src/jogl/classes/com/sun/javafx/audio/windows/waveout/TestSpatialization.java b/src/jogl/classes/com/jogamp/audio/windows/waveout/TestSpatialization.java index 4bf967a02..78fb3493f 100755 --- a/src/jogl/classes/com/sun/javafx/audio/windows/waveout/TestSpatialization.java +++ b/src/jogl/classes/com/jogamp/audio/windows/waveout/TestSpatialization.java @@ -30,9 +30,10 @@ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ -package com.sun.javafx.audio.windows.waveout; +package com.jogamp.audio.windows.waveout; import java.io.*; +import javax.media.nativewindow.NativeWindow; import javax.media.opengl.GLDrawableFactory; public class TestSpatialization { diff --git a/src/jogl/classes/com/sun/javafx/audio/windows/waveout/Track.java b/src/jogl/classes/com/jogamp/audio/windows/waveout/Track.java index 190396112..b57bf1dc6 100755 --- a/src/jogl/classes/com/sun/javafx/audio/windows/waveout/Track.java +++ b/src/jogl/classes/com/jogamp/audio/windows/waveout/Track.java @@ -30,7 +30,7 @@ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ -package com.sun.javafx.audio.windows.waveout; +package com.jogamp.audio.windows.waveout; import java.io.*; import java.nio.*; diff --git a/src/jogl/classes/com/sun/javafx/audio/windows/waveout/Vec3f.java b/src/jogl/classes/com/jogamp/audio/windows/waveout/Vec3f.java index 9a3038e35..1afdaf081 100755 --- a/src/jogl/classes/com/sun/javafx/audio/windows/waveout/Vec3f.java +++ b/src/jogl/classes/com/jogamp/audio/windows/waveout/Vec3f.java @@ -30,7 +30,7 @@ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ -package com.sun.javafx.audio.windows.waveout; +package com.jogamp.audio.windows.waveout; /** 3-element single-precision vector */ diff --git a/src/jogl/classes/com/sun/opengl/cg/CgException.java b/src/jogl/classes/com/jogamp/opengl/cg/CgException.java index 3380bb540..8bfd9e23e 100644 --- a/src/jogl/classes/com/sun/opengl/cg/CgException.java +++ b/src/jogl/classes/com/jogamp/opengl/cg/CgException.java @@ -37,7 +37,7 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.cg; +package com.jogamp.opengl.cg; /** * A generic exception for errors that occur throughout the NVidia Cg diff --git a/src/jogl/classes/com/sun/opengl/impl/DRIHack.java b/src/jogl/classes/com/jogamp/opengl/impl/DRIHack.java index 63a2f7ecd..7e81d194b 100755 --- a/src/jogl/classes/com/sun/opengl/impl/DRIHack.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/DRIHack.java @@ -37,11 +37,12 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.impl; +package com.jogamp.opengl.impl; +import com.jogamp.common.os.NativeLibrary; +import com.jogamp.common.os.Platform; import java.io.*; import java.security.*; -import com.sun.gluegen.runtime.*; /** * Helper class for working around problems with open-source DRI @@ -76,27 +77,31 @@ import com.sun.gluegen.runtime.*; */ public class DRIHack { + private static final boolean DEBUG = Debug.debug("DRIHack"); private static boolean driHackNeeded; private static NativeLibrary oglLib; - public static void begin() { - AccessController.doPrivileged(new PrivilegedAction() { - public Object run() { - String os = Debug.getProperty("os.name", false).toLowerCase(); - // Do DRI hack on all Linux distributions for best robustness - driHackNeeded = - (os.startsWith("linux") || - new File("/usr/lib/dri").exists() || - new File("/usr/X11R6/lib/modules/dri").exists()); - // Allow manual overriding for now as a workaround for - // problems seen in some situations -- needs more investigation - if (Debug.getProperty("jogl.drihack.disable", true) != null) { + static { + // Allow manual overriding for now as a workaround for + // problems seen in some situations -- needs more investigation + if (Debug.getProperty("jogl.drihack.disable", true) != null) { driHackNeeded = false; - } - return null; + } else { + AccessController.doPrivileged(new PrivilegedAction() { + public Object run() { + String os = Platform.getOS().toLowerCase(); + // Do DRI hack on all Linux distributions for best robustness + driHackNeeded = os.startsWith("linux") + || new File("/usr/lib/dri").exists() + || new File("/usr/X11R6/lib/modules/dri").exists(); + return null; + } + }); } - }); + } + + public static void begin() { if (driHackNeeded) { if (DEBUG) { @@ -106,12 +111,17 @@ public class DRIHack { // Try a few different variants for best robustness // In theory probably only the first is necessary oglLib = NativeLibrary.open("libGL.so.1", null); - if (DEBUG && oglLib != null) System.err.println(" Found libGL.so.1"); + if (DEBUG && oglLib != null) { + System.err.println(" Found libGL.so.1"); + } if (oglLib == null) { oglLib = NativeLibrary.open("/usr/lib/libGL.so.1", null); - if (DEBUG && oglLib != null) System.err.println(" Found /usr/lib/libGL.so.1"); + if (DEBUG && oglLib != null) { + System.err.println(" Found /usr/lib/libGL.so.1"); + } } } + } public static void end() { diff --git a/src/jogl/classes/com/sun/opengl/impl/Debug.java b/src/jogl/classes/com/jogamp/opengl/impl/Debug.java index 7c5451706..82a5f2ff2 100644 --- a/src/jogl/classes/com/sun/opengl/impl/Debug.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/Debug.java @@ -37,7 +37,7 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.impl; +package com.jogamp.opengl.impl; import java.security.*; diff --git a/src/jogl/classes/com/sun/opengl/impl/ExtensionAvailabilityCache.java b/src/jogl/classes/com/jogamp/opengl/impl/ExtensionAvailabilityCache.java index 26072519e..9d1235e13 100644 --- a/src/jogl/classes/com/sun/opengl/impl/ExtensionAvailabilityCache.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/ExtensionAvailabilityCache.java @@ -37,7 +37,7 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.impl; +package com.jogamp.opengl.impl; import javax.media.opengl.*; import java.util.*; @@ -66,12 +66,10 @@ public final class ExtensionAvailabilityCache { public void flush() { if(DEBUG) { - System.out.println("ExtensionAvailabilityCache: Flush availability OpenGL "+majorVersion+"."+minorVersion); + System.out.println("ExtensionAvailabilityCache: Flush availability OpenGL "+context.getGLVersion()); } availableExtensionCache.clear(); initialized = false; - majorVersion = 1; - minorVersion = 0; } /** @@ -104,53 +102,21 @@ public final class ExtensionAvailabilityCache { return glExtensions; } - public int getMajorVersion() { - initAvailableExtensions(); - return majorVersion; - } - - public int getMinorVersion() { - initAvailableExtensions(); - return minorVersion; - } - 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) { - GL gl = context.getGL(); - if (DEBUG) { - System.err.println("ExtensionAvailabilityCache: Pre-caching init "+gl+", GL_VERSION "+gl.glGetString(GL.GL_VERSION)); - } - - // Set version - Version version = new Version(gl.glGetString(GL.GL_VERSION)); - if (version.isValid()) { - majorVersion = version.getMajor(); - minorVersion = version.getMinor(); - - if( !gl.isGL3() && - ( majorVersion > 3 || - ( majorVersion == 3 && minorVersion >= 1 ) ) ) { - // downsize version to 3.0 in case we are not using GL3 (3.1) - majorVersion = 3; - minorVersion = 0; - } + System.err.println("ExtensionAvailabilityCache: Pre-caching init "+gl+", OpenGL "+context.getGLVersion()); } boolean useGetStringi = false; - if ( majorVersion > 3 || - ( majorVersion == 3 && minorVersion >= 0 ) || - gl.isGL3() ) { - if ( ! gl.isGL2GL3() ) { + if ( gl.isGL2GL3() ) { + if ( ! gl.isFunctionAvailable("glGetStringi") ) { if(DEBUG) { - System.err.println("ExtensionAvailabilityCache: GL >= 3.1 usage, but no GL2GL3 interface: "+gl.getClass().getName()); - } - } else if ( ! gl.isFunctionAvailable("glGetStringi") ) { - if(DEBUG) { - System.err.println("ExtensionAvailabilityCache: GL >= 3.1 usage, but no glGetStringi"); + System.err.println("GLContext: GL >= 3.1 usage, but no glGetStringi"); } } else { useGetStringi = true; @@ -158,7 +124,7 @@ public final class ExtensionAvailabilityCache { } if (DEBUG) { - System.err.println("ExtensionAvailabilityCache: Pre-caching extension availability OpenGL "+majorVersion+"."+minorVersion+ + System.err.println("ExtensionAvailabilityCache: Pre-caching extension availability OpenGL "+context.getGLVersion()+ ", use "+ ( useGetStringi ? "glGetStringi" : "glGetString" ) ); } @@ -197,39 +163,21 @@ public final class ExtensionAvailabilityCache { } } - // Put GL version strings in the table as well - // FIXME: this needs to be adjusted when the major rev changes - // beyond the known ones - int major = majorVersion; - int minor = minorVersion; - while (major > 0) { - while (minor >= 0) { - availableExtensionCache.add("GL_VERSION_" + major + "_" + minor); - if (DEBUG) { - System.err.println("ExtensionAvailabilityCache: Added GL_VERSION_" + major + "_" + minor + " to known extensions"); - } - --minor; - } - - switch (major) { - case 3: - if(gl.isGL3()) { - // GL3 is a GL 3.1 forward compatible context, - // hence no 2.0, 1.0 - 1.5 GL versions are supported. - major=0; - } - // Restart loop at version 2.1 - minor = 1; - break; - case 2: - // Restart loop at version 1.5 - minor = 5; - break; - case 1: - break; + int major[] = new int[] { context.getGLVersionMajor() }; + int minor[] = new int[] { context.getGLVersionMinor() }; + if( !gl.isGL3() && !gl.isGL4() && + ( major[0] > 3 || + ( major[0] == 3 && minor[0] >= 1 ) ) ) { + // downsize version to 3.0 in case we are not using GL3 (>=3.1) + major[0] = 3; + minor[0] = 0; + } + while (GLContext.isValidGLVersion(major[0], minor[0])) { + availableExtensionCache.add("GL_VERSION_" + major[0] + "_" + minor[0]); + if (DEBUG) { + System.err.println("ExtensionAvailabilityCache: Added GL_VERSION_" + major[0] + "_" + minor[0] + " to known extensions"); } - - --major; + if(!GLContext.decrementGLVersion(major, minor)) break; } // put a dummy var in here so that the cache is no longer empty even if @@ -255,136 +203,9 @@ public final class ExtensionAvailabilityCache { // private boolean initialized = false; - private int majorVersion = 1; - private int minorVersion = 0; private String glExtensions = null; private String glXExtensions = null; private HashSet availableExtensionCache = new HashSet(50); private GLContextImpl context; - /** - * 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) - { - // FIXME: refactor desktop OpenGL dependencies and make this - // class work properly for OpenGL ES - System.err.println("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/sun/opengl/impl/GLBufferSizeTracker.java b/src/jogl/classes/com/jogamp/opengl/impl/GLBufferSizeTracker.java index 53fcc2de1..48affa534 100755 --- a/src/jogl/classes/com/sun/opengl/impl/GLBufferSizeTracker.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/GLBufferSizeTracker.java @@ -37,7 +37,7 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.impl; +package com.jogamp.opengl.impl; import java.util.*; import javax.media.opengl.*; diff --git a/src/jogl/classes/com/sun/opengl/impl/GLBufferStateTracker.java b/src/jogl/classes/com/jogamp/opengl/impl/GLBufferStateTracker.java index c61d3602d..df8d673a1 100755 --- a/src/jogl/classes/com/sun/opengl/impl/GLBufferStateTracker.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/GLBufferStateTracker.java @@ -37,7 +37,7 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.impl; +package com.jogamp.opengl.impl; import java.util.*; import javax.media.opengl.*; diff --git a/src/jogl/classes/com/sun/opengl/impl/GLContextImpl.java b/src/jogl/classes/com/jogamp/opengl/impl/GLContextImpl.java index 97100208d..7143344bf 100644 --- a/src/jogl/classes/com/sun/opengl/impl/GLContextImpl.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/GLContextImpl.java @@ -37,15 +37,18 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.impl; +package com.jogamp.opengl.impl; +import com.jogamp.common.os.DynamicLookupHelper; import java.nio.*; -import java.lang.reflect.*; +import java.util.*; import javax.media.opengl.*; -import com.sun.nativewindow.impl.NWReflection; -import com.sun.gluegen.runtime.*; -import com.sun.gluegen.runtime.opengl.*; +import javax.media.nativewindow.*; +import com.jogamp.gluegen.runtime.*; +import com.jogamp.gluegen.runtime.opengl.*; +import com.jogamp.common.JogampRuntimeException; +import com.jogamp.common.util.ReflectionUtil; public abstract class GLContextImpl extends GLContext { protected GLContextLock lock = new GLContextLock(); @@ -121,69 +124,33 @@ public abstract class GLContextImpl extends GLContext { return (GLDrawableImpl) getGLDrawable(); } - public int makeCurrent() throws GLException { - // Support calls to makeCurrent() over and over again with - // different contexts without releasing them - // Could implement this more efficiently without explicit - // releasing of the underlying context; would require more error - // checking during the makeCurrentImpl phase - 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(); - } - } + public final GL getGL() { + return gl; + } - if (GLWorkerThread.isStarted() && - !GLWorkerThread.isWorkerThread()) { - // Kick the GLWorkerThread off its current context - GLWorkerThread.invokeLater(new Runnable() { public void run() {} }); + public GL setGL(GL gl) { + if(DEBUG) { + String sgl1 = (null!=this.gl)?this.gl.getClass().toString()+", "+this.gl.toString():new String("<null>"); + String sgl2 = (null!=gl)?gl.getClass().toString()+", "+gl.toString():new String("<null>"); + Exception e = new Exception("setGL (OpenGL "+getGLVersion()+"): "+Thread.currentThread()+", "+sgl1+" -> "+sgl2); + e.printStackTrace(); } + this.gl = gl; + return gl; + } - lock.lock(); - int res = 0; - try { - res = makeCurrentImpl(); - - /* 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); + // This is only needed for Mac OS X on-screen contexts + protected void update() throws GLException { } - /* FIXME: refactor dependence on Java 2D / JOGL bridge + public boolean isSynchronized() { + return !lock.getFailFastMode(); + } - // 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; + public void setSynchronized(boolean isSynchronized) { + lock.setFailFastMode(!isSynchronized); } - protected abstract int makeCurrentImpl() throws GLException; + public abstract Object getPlatformGLExtensions(); public void release() throws GLException { if (!lock.isHeld()) { @@ -240,7 +207,7 @@ public abstract class GLContextImpl extends GLContext { } if (glStateTracker != null) { - glStateTracker.clearStates(); + glStateTracker.clearStates(false); } destroyImpl(); @@ -251,41 +218,391 @@ public abstract class GLContextImpl extends GLContext { protected abstract void destroyImpl() throws GLException; - // This is only needed for Mac OS X on-screen contexts - protected void update() 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> {@link #makeCurrentImpl} <i>Platform Implementation</i> + * <li> {@link #create} <i>Platform Implementation</i> + * <li> If <code>ARB_create_context</code> is supported: + * <ul> + * <li> {@link #createContextARB} <i>GLContextImpl</i> + * <li> {@link #createContextARBImpl} <i>Platform Implementation</i> + * </ul> + * </ul><br> + * + * Once at startup, ie triggered by the singleton {@link GLDrawableImpl} constructor, + * 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} + * </ul> + * <li> {@link #mapVersionAvailable} + * </ul> + * </ul><br> + * + * @see #makeCurrentImpl + * @see #create + * @see #createContextARB + * @see #createContextARBImpl + * @see #mapVersionAvailable + * @see #destroyContextARBImpl + */ + public int makeCurrent() throws GLException { + // Support calls to makeCurrent() over and over again with + // different contexts without releasing them + // Could implement this more efficiently without explicit + // releasing of the underlying context; would require more error + // checking during the makeCurrentImpl phase + 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() {} }); + } + + lock.lock(); + int res = 0; + try { + res = makeCurrentImpl(); + + /* 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; } - public boolean isSynchronized() { - return !lock.getFailFastMode(); + /** + * @see #makeCurrent + */ + protected abstract int makeCurrentImpl() throws GLException; + + /** + * @see #makeCurrent + */ + protected abstract void create() 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> + * + * @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> + * + * @see #makeCurrentImpl + * @see #create + * @see #createContextARB + * @see #createContextARBImpl + * @see #destroyContextARBImpl + */ + protected long createContextARB(long share, boolean direct, + int major[], int minor[], int ctp[]) + { + AbstractGraphicsConfiguration config = drawable.getNativeWindow().getGraphicsConfiguration().getNativeGraphicsConfiguration(); + GLCapabilities glCaps = (GLCapabilities) config.getChosenCapabilities(); + GLProfile glp = glCaps.getGLProfile(); + long _context = 0; + + if( !mappedVersionsAvailableSet ) { + synchronized(mappedVersionsAvailableLock) { + if( !mappedVersionsAvailableSet ) { + createContextARBMapVersionsAvailable(4, false /* compat */); // GL4 + createContextARBMapVersionsAvailable(4, true /* compat */); // GL4bc + createContextARBMapVersionsAvailable(3, false /* compat */); // GL3 + createContextARBMapVersionsAvailable(3, true /* compat */); // GL3bc + createContextARBMapVersionsAvailable(2, true /* compat */); // GL2 + mappedVersionsAvailableSet=true; + } + } + } + + 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 key = compose8bit(reqMajor, compat?CTX_PROFILE_COMPAT:CTX_PROFILE_CORE, 0, 0); + int val = mappedVersionsAvailable.get( key ); + long _ctx = 0; + if(val>0) { + int _major = getComposed8bit(val, 1); + int _minor = getComposed8bit(val, 2); + int _ctp = getComposed8bit(val, 3); + + _ctx = createContextARBImpl(share, direct, _ctp, _major, _minor); + if(0!=_ctx) { + setGLFunctionAvailability(true, _major, _minor, _ctp); + } + } + return _ctx; } - public void setSynchronized(boolean isSynchronized) { - lock.setFailFastMode(!isSynchronized); + private void createContextARBMapVersionsAvailable(int reqMajor, boolean compat) + { + long _context; + 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) { + destroyContextARBImpl(_context); + mapVersionAvailable(reqMajor, compat, major[0], minor[0], ctp); + } } - public final GL getGL() { - return gl; + private 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 ) ) { + + _context = createContextARBImpl(share, direct, ctxOptionFlags, major[0], minor[0]); + + if(0==_context) { + if(!GLContext.decrementGLVersion(major, minor)) break; + } + } + return _context; } - public GL setGL(GL gl) { - if(DEBUG) { - String sgl1 = (null!=this.gl)?this.gl.getClass().toString()+", "+this.gl.toString():new String("<null>"); - String sgl2 = (null!=gl)?gl.getClass().toString()+", "+gl.toString():new String("<null>"); - Exception e = new Exception("setGL: "+Thread.currentThread()+", "+sgl1+" -> "+sgl2); - e.printStackTrace(); + //---------------------------------------------------------------------- + // 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 .. + */ + protected void setContextVersion(int major, int minor, int ctp) { + if (0==ctp) { + GLException e = new GLException("Invalid GL Version "+major+"."+minor+", ctp "+toHexString(ctp)); + throw e; + } + 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(gl, 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(); + + ctxVersionString = getGLVersion(gl, ctxMajorVersion, ctxMinorVersion, ctxOptions, versionStr); + return; + } + } + } + + private static boolean appendString(StringBuffer sb, String string, boolean needColon, boolean condition) { + if(condition) { + if(needColon) { + sb.append(", "); + } + sb.append(string); + needColon=true; } - this.gl = gl; - return gl; + return needColon; } - public abstract Object getPlatformGLExtensions(); + protected static String getGLVersion(GL gl, int major, int minor, int ctp, String gl_version) { + boolean needColon = false; + StringBuffer sb = new StringBuffer(); + sb.append(major); + sb.append("."); + sb.append(minor); + sb.append(" ("); + needColon = appendString(sb, "ES", needColon, null!=gl && gl.isGLES()); + needColon = appendString(sb, "compatibility profile", needColon, 0 != ( CTX_PROFILE_COMPAT & ctp )); + needColon = appendString(sb, "core profile", needColon, 0 != ( CTX_PROFILE_CORE & ctp )); + needColon = appendString(sb, "forward compatible", needColon, 0 != ( CTX_OPTION_FORWARD & ctp )); + needColon = appendString(sb, "any", needColon, 0 != ( CTX_OPTION_ANY & ctp )); + needColon = appendString(sb, "new", needColon, 0 != ( CTX_IS_ARB_CREATED & ctp )); + needColon = appendString(sb, "old", needColon, 0 == ( CTX_IS_ARB_CREATED & ctp )); + sb.append(") - "); + if(null!=gl_version) { + sb.append(gl_version); + } else { + sb.append("n/a"); + } + return sb.toString(); + } //---------------------------------------------------------------------- // Helpers for various context implementations // private Object createInstance(GLProfile glp, String suffix, Class[] cstrArgTypes, Object[] cstrArgs) { - return NWReflection.createInstance(glp.getGLImplBaseClassName()+suffix, cstrArgTypes, cstrArgs); + return ReflectionUtil.createInstance(glp.getGLImplBaseClassName()+suffix, cstrArgTypes, cstrArgs); } /** Create the GL for this context. */ @@ -346,13 +663,30 @@ public abstract class GLContextImpl extends GLContext { /** 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 abstract String mapToRealGLFunctionName(String glFunctionName); + 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" and "GL_ARB_pixel_format" to "WGL_ARB_pbuffer" - and "WGL_ARB_pixel_format" (not yet mapped to X11). */ - protected abstract String mapToRealGLExtensionName(String glExtensionName); + "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. */ @@ -373,8 +707,10 @@ public abstract class GLContextImpl extends GLContext { * * @param force force the setting, even if is already being set. * This might be usefull if you change the OpenGL implementation. + * + * @see #setContextVersion */ - protected void setGLFunctionAvailability(boolean force) { + protected void setGLFunctionAvailability(boolean force, int major, int minor, int ctp) { if(null!=this.gl && null!=glProcAddressTable && !force) { return; // already done and not forced } @@ -382,15 +718,17 @@ public abstract class GLContextImpl extends GLContext { setGL(createGL(getGLDrawable().getGLProfile())); } - updateGLProcAddressTable(); + updateGLProcAddressTable(major, minor, ctp); } /** * Updates 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". + * + * @see #setContextVersion */ - protected void updateGLProcAddressTable() { + protected void updateGLProcAddressTable(int major, int minor, int ctp) { if(null==this.gl) { throw new GLException("setGLFunctionAvailability not called yet"); } @@ -404,6 +742,8 @@ public abstract class GLContextImpl extends GLContext { } resetProcAddressTable(getGLProcAddressTable()); + setContextVersion(major, minor, ctp); + extensionAvailability.reset(); } @@ -475,14 +815,6 @@ public abstract class GLContextImpl extends GLContext { return extensionAvailability.getGLExtensions(); } - public int getMajorVersion() { - return extensionAvailability.getMajorVersion(); - } - - public int getMinorVersion() { - return extensionAvailability.getMinorVersion(); - } - public boolean isExtensionCacheInitialized() { return extensionAvailability.isInitialized(); } @@ -507,10 +839,6 @@ public abstract class GLContextImpl extends GLContext { return Thread.currentThread().getName(); } - public static String toHexString(long hex) { - return "0x" + Long.toHexString(hex); - } - //---------------------------------------------------------------------- // Helpers for buffer object optimizations @@ -599,4 +927,131 @@ public abstract class GLContextImpl extends GLContext { */ + /** + * 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("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/sun/opengl/impl/GLContextLock.java b/src/jogl/classes/com/jogamp/opengl/impl/GLContextLock.java index 753ef14f8..56a5b023f 100644 --- a/src/jogl/classes/com/sun/opengl/impl/GLContextLock.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/GLContextLock.java @@ -37,7 +37,7 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.impl; +package com.jogamp.opengl.impl; import javax.media.opengl.*; diff --git a/src/jogl/classes/com/sun/opengl/impl/GLContextShareSet.java b/src/jogl/classes/com/jogamp/opengl/impl/GLContextShareSet.java index 5f8fc1c84..abeb231f4 100644 --- a/src/jogl/classes/com/sun/opengl/impl/GLContextShareSet.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/GLContextShareSet.java @@ -37,7 +37,7 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.impl; +package com.jogamp.opengl.impl; // FIXME: refactor Java SE dependencies // import java.awt.GraphicsConfiguration; diff --git a/src/jogl/classes/com/sun/opengl/impl/GLDrawableFactoryImpl.java b/src/jogl/classes/com/jogamp/opengl/impl/GLDrawableFactoryImpl.java index ceef07727..cdf5beb24 100644 --- a/src/jogl/classes/com/sun/opengl/impl/GLDrawableFactoryImpl.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/GLDrawableFactoryImpl.java @@ -37,13 +37,13 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.impl; +package com.jogamp.opengl.impl; import java.nio.*; import javax.media.nativewindow.*; import javax.media.opengl.*; -import com.sun.gluegen.runtime.*; -import com.sun.nativewindow.impl.NWReflection; +import com.jogamp.common.util.*; +import com.jogamp.gluegen.runtime.*; import java.lang.reflect.*; /** Extends GLDrawableFactory with a few methods for handling @@ -54,10 +54,24 @@ import java.lang.reflect.*; public abstract class GLDrawableFactoryImpl extends GLDrawableFactory { protected static final boolean DEBUG = Debug.debug("GLDrawableFactory"); + private boolean isValid = false; + + public void shutdown() { + validate(); + isValid = false; + } + + protected final void validate() { + if(!isValid) { + throw new GLException("GLDrawableFactory is already shutdown!"); + } + } + //--------------------------------------------------------------------------- // Dispatching GLDrawable construction in respect to the NativeWindow Capabilities // public GLDrawable createGLDrawable(NativeWindow target) { + validate(); if (target == null) { throw new IllegalArgumentException("Null target"); } @@ -65,9 +79,6 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory { GLCapabilities caps = (GLCapabilities) target.getGraphicsConfiguration().getNativeGraphicsConfiguration().getChosenCapabilities(); GLDrawable result = null; if(caps.isOnscreen()) { - if(caps.isPBuffer()) { - throw new IllegalArgumentException("Onscreen target can't be PBuffer: "+caps); - } if(DEBUG) { System.out.println("GLDrawableFactoryImpl.createGLDrawable -> OnscreenDrawable: "+target); } @@ -76,7 +87,7 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory { if( ! ( target instanceof SurfaceChangeable ) ) { throw new IllegalArgumentException("Passed NativeWindow must implement SurfaceChangeable for offscreen: "+target); } - if(caps.isPBuffer() && canCreateGLPbuffer()) { + if(caps.isPBuffer()) { if(DEBUG) { System.out.println("GLDrawableFactoryImpl.createGLDrawable -> PbufferDrawable: "+target); } @@ -111,7 +122,7 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory { protected abstract GLDrawableImpl createGLPbufferDrawableImpl(NativeWindow target); protected GLDrawableImpl createGLPbufferDrawable(NativeWindow target) { - if (!canCreateGLPbuffer()) { + if (!canCreateGLPbuffer(target.getGraphicsConfiguration().getNativeGraphicsConfiguration().getScreen().getDevice())) { throw new GLException("Pbuffer support not available with current graphics card"); } return createGLPbufferDrawableImpl(target); @@ -121,11 +132,12 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory { GLCapabilitiesChooser chooser, int width, int height) { + validate(); if(height<=0 || height<=0) { throw new GLException("Width and height of pbuffer must be positive (were (" + width + ", " + height + "))"); } - capabilities.setDoubleBuffered(false); // FIXME + capabilities.setDoubleBuffered(false); // FIXME DBLBUFOFFSCRN capabilities.setOnscreen(false); capabilities.setPBuffer(true); return createGLPbufferDrawable( createOffscreenWindow(capabilities, chooser, height, height) ); @@ -136,6 +148,7 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory { int width, int height, GLContext shareWith) { + validate(); return new GLPbufferImpl( (GLDrawableImpl) createGLPbufferDrawable(capabilities, chooser, height, height), shareWith); } @@ -152,11 +165,12 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory { GLCapabilitiesChooser chooser, int width, int height) { + validate(); if(width<=0 || height<=0) { throw new GLException("Width and height of pbuffer must be positive (were (" + width + ", " + height + "))"); } - capabilities.setDoubleBuffered(false); // FIXME + capabilities.setDoubleBuffered(false); // FIXME DBLBUFOFFSCRN capabilities.setOnscreen(false); capabilities.setPBuffer(false); return createOffscreenDrawable( createOffscreenWindow(capabilities, chooser, width, height) ); @@ -169,8 +183,12 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory { protected abstract NativeWindow createOffscreenWindow(GLCapabilities capabilities, GLCapabilitiesChooser chooser, int width, int height); + protected abstract GLDrawableImpl getSharedDrawable(); + protected abstract GLContextImpl getSharedContext(); + protected GLDrawableFactoryImpl() { super(); + isValid = true; } protected void maybeDoSingleThreadedWorkaround(Runnable action) { @@ -215,7 +233,7 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory { // implement this functionality on all other platforms // - public abstract boolean canCreateContextOnJava2DSurface(); + public abstract boolean canCreateContextOnJava2DSurface(AbstractGraphicsDevice device); public abstract GLContext createContextOnJava2DSurface(Object graphics, GLContext shareWith) throws GLException; @@ -276,6 +294,7 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory { * out-of-bounds */ public boolean setDisplayGamma(float gamma, float brightness, float contrast) throws IllegalArgumentException { + validate(); if ((brightness < -1.0f) || (brightness > 1.0f)) { throw new IllegalArgumentException("Brightness must be between -1.0 and 1.0"); } @@ -308,11 +327,12 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory { } public synchronized void resetDisplayGamma() { + validate(); if (gammaShutdownHook == null) { throw new IllegalArgumentException("Should not call this unless setDisplayGamma called first"); } resetGammaRamp(originalGammaRamp); - unregisterGammeShutdownHook(); + unregisterGammaShutdownHook(); } //------------------------------------------------------ @@ -364,7 +384,7 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory { gammaShutdownHookRegistered = true; } - private synchronized void unregisterGammeShutdownHook() { + private synchronized void unregisterGammaShutdownHook() { if (!gammaShutdownHookRegistered) return; if (gammaShutdownHook == null) { diff --git a/src/jogl/classes/com/sun/opengl/impl/GLDrawableHelper.java b/src/jogl/classes/com/jogamp/opengl/impl/GLDrawableHelper.java index d6ca2cbf5..7a4e84081 100644 --- a/src/jogl/classes/com/sun/opengl/impl/GLDrawableHelper.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/GLDrawableHelper.java @@ -37,7 +37,7 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.impl; +package com.jogamp.opengl.impl; import java.util.*; import javax.media.opengl.*; diff --git a/src/jogl/classes/com/sun/opengl/impl/GLDrawableImpl.java b/src/jogl/classes/com/jogamp/opengl/impl/GLDrawableImpl.java index befee170f..2fef8fd80 100644 --- a/src/jogl/classes/com/sun/opengl/impl/GLDrawableImpl.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/GLDrawableImpl.java @@ -37,11 +37,11 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.impl; +package com.jogamp.opengl.impl; +import com.jogamp.common.os.DynamicLookupHelper; import javax.media.nativewindow.*; import javax.media.opengl.*; -import com.sun.gluegen.runtime.DynamicLookupHelper; public abstract class GLDrawableImpl implements GLDrawable { protected static final boolean DEBUG = Debug.debug("GLDrawable"); @@ -88,7 +88,7 @@ public abstract class GLDrawableImpl implements GLDrawable { protected abstract void swapBuffersImpl(); public static String toHexString(long hex) { - return GLContextImpl.toHexString(hex); + return "0x" + Long.toHexString(hex); } public GLProfile getGLProfile() { @@ -153,11 +153,9 @@ public abstract class GLDrawableImpl implements GLDrawable { } public String toString() { - return getClass().getName()+"[realized "+getRealized()+ - ",\n\tfactory "+getFactory()+ - ",\n\twindow "+getNativeWindow()+ - ",\n\trequested "+getRequestedGLCapabilities()+ - ",\n\tchosen "+getChosenGLCapabilities()+"]"; + return getClass().getName()+"[Realized "+getRealized()+ + ",\n\tFactory "+getFactory()+ + ",\n\tWindow "+getNativeWindow()+"]"; } protected GLDrawableFactory factory; diff --git a/src/jogl/classes/com/sun/opengl/impl/NativeLibLoader.java b/src/jogl/classes/com/jogamp/opengl/impl/GLJNILibLoader.java index 59f92e53f..c3958eedf 100644 --- a/src/jogl/classes/com/sun/opengl/impl/NativeLibLoader.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/GLJNILibLoader.java @@ -37,7 +37,7 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.impl; +package com.jogamp.opengl.impl; // FIXME: refactor Java SE dependencies //import java.awt.Toolkit; @@ -46,9 +46,9 @@ import java.lang.reflect.Method; import java.security.AccessController; import java.security.PrivilegedAction; import java.util.HashSet; -import com.sun.nativewindow.impl.NativeLibLoaderBase; +import com.jogamp.common.jvm.JNILibLoaderBase; -public class NativeLibLoader extends NativeLibLoaderBase { +public class GLJNILibLoader extends JNILibLoaderBase { public static void loadNEWT() { AccessController.doPrivileged(new PrivilegedAction() { public Object run() { @@ -61,7 +61,7 @@ public class NativeLibLoader extends NativeLibLoaderBase { public static void loadGLDesktop() { AccessController.doPrivileged(new PrivilegedAction() { public Object run() { - loadLibrary("jogl_gl2", nativeOSPreload, true); + loadLibrary("jogl_desktop", nativeOSPreload, true); return null; } }); diff --git a/src/jogl/classes/com/sun/opengl/impl/GLPbufferImpl.java b/src/jogl/classes/com/jogamp/opengl/impl/GLPbufferImpl.java index ffaf798ae..dd8d980a6 100644 --- a/src/jogl/classes/com/sun/opengl/impl/GLPbufferImpl.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/GLPbufferImpl.java @@ -37,7 +37,7 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.impl; +package com.jogamp.opengl.impl; /** import java.awt.Dimension; diff --git a/src/jogl/classes/com/sun/opengl/impl/GLStateTracker.java b/src/jogl/classes/com/jogamp/opengl/impl/GLStateTracker.java index 698d20c47..744e7b924 100755 --- a/src/jogl/classes/com/sun/opengl/impl/GLStateTracker.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/GLStateTracker.java @@ -37,7 +37,7 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.impl; +package com.jogamp.opengl.impl; import java.util.*; import javax.media.opengl.*; @@ -52,7 +52,7 @@ import javax.media.opengl.*; public class GLStateTracker { private static final boolean DEBUG = Debug.debug("GLStateTracker"); - private boolean enabled = true; + private volatile boolean enabled = true; private Map/*<Integer,Integer>*/ pixelStateMap = new HashMap/*<Integer,Integer>*/(); @@ -75,7 +75,8 @@ public class GLStateTracker { resetStates(); } - public void clearStates() { + public void clearStates(boolean enable) { + enabled = enable; pixelStateMap.clear(); } @@ -91,7 +92,13 @@ public class GLStateTracker { if(enabled) { Integer key = boxKey(pname); if(null!=key) { - params[params_offset] = ((Integer) pixelStateMap.get(key)).intValue(); + Integer value = (Integer) pixelStateMap.get(key); + if(null!=value) { + params[params_offset] = value.intValue(); + } else { + GLException re = new GLException("Key (0x"+Integer.toHexString(key.intValue())+") is not mapped"); + throw re; + } return true; } } @@ -102,7 +109,13 @@ public class GLStateTracker { if(enabled) { Integer key = boxKey(pname); if(null!=key) { - params.put(params.position(), ((Integer) pixelStateMap.get(key)).intValue()); + Integer value = (Integer) pixelStateMap.get(key); + if(null!=value) { + params.put(params.position(), value.intValue()); + } else { + GLException re = new GLException("Key (0x"+Integer.toHexString(key.intValue())+") is not mapped"); + throw re; + } return true; } } @@ -138,11 +151,11 @@ public class GLStateTracker { throw new GLException("null stack element (remaining stack size "+stack.size()+")"); } - clearStates(); - + Map/*<Integer,Integer>*/ pixelStateMapNew = new HashMap/*<Integer,Integer>*/(); if ( null != state.getPixelStateMap() ) { - pixelStateMap.putAll(state.getPixelStateMap()); + pixelStateMapNew.putAll(state.getPixelStateMap()); } + pixelStateMap = pixelStateMapNew; } } diff --git a/src/jogl/classes/com/sun/opengl/impl/GLWorkerThread.java b/src/jogl/classes/com/jogamp/opengl/impl/GLWorkerThread.java index b110e4335..768eea3f7 100755 --- a/src/jogl/classes/com/sun/opengl/impl/GLWorkerThread.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/GLWorkerThread.java @@ -37,7 +37,7 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.impl; +package com.jogamp.opengl.impl; import java.lang.reflect.InvocationTargetException; import java.security.*; diff --git a/src/jogl/classes/com/sun/opengl/impl/InternalBufferUtil.java.javame_cdc_fp b/src/jogl/classes/com/jogamp/opengl/impl/InternalBufferUtil.java.javame_cdc_fp index 32c3cd70c..4a0eaa22b 100644 --- a/src/jogl/classes/com/sun/opengl/impl/InternalBufferUtil.java.javame_cdc_fp +++ b/src/jogl/classes/com/jogamp/opengl/impl/InternalBufferUtil.java.javame_cdc_fp @@ -31,13 +31,13 @@ * */ -package com.sun.opengl.impl; +package com.jogamp.opengl.impl; import java.lang.reflect.*; import java.nio.*; /** Internal copy of selected routines from BufferUtil to avoid - outward dependencies on com.sun.opengl.util package. */ + outward dependencies on com.jogamp.opengl.util package. */ public class InternalBufferUtil { public static final int SIZEOF_BYTE = 1; public static final int SIZEOF_SHORT = 2; diff --git a/src/jogl/classes/com/sun/opengl/impl/InternalBufferUtil.java.javase b/src/jogl/classes/com/jogamp/opengl/impl/InternalBufferUtil.java.javase index 59d44f04d..655fa95de 100644 --- a/src/jogl/classes/com/sun/opengl/impl/InternalBufferUtil.java.javase +++ b/src/jogl/classes/com/jogamp/opengl/impl/InternalBufferUtil.java.javase @@ -31,13 +31,13 @@ * */ -package com.sun.opengl.impl; +package com.jogamp.opengl.impl; import java.lang.reflect.*; import java.nio.*; /** Internal copy of selected routines from BufferUtil to avoid - outward dependencies on com.sun.opengl.util package. */ + outward dependencies on com.jogamp.opengl.util package. */ public class InternalBufferUtil { public static final int SIZEOF_BYTE = 1; public static final int SIZEOF_SHORT = 2; diff --git a/src/jogl/classes/com/sun/opengl/impl/ProjectFloat.java b/src/jogl/classes/com/jogamp/opengl/impl/ProjectFloat.java index cc8ba639f..dbd84c9de 100755 --- a/src/jogl/classes/com/sun/opengl/impl/ProjectFloat.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/ProjectFloat.java @@ -1,7 +1,7 @@ /* ** 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 1.1 (the "License"), the contents of this +** 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 @@ -112,7 +112,7 @@ * in the design, construction, operation or maintenance of any nuclear * facility. */ -package com.sun.opengl.impl; +package com.jogamp.opengl.impl; import java.nio.*; diff --git a/src/jogl/classes/com/sun/opengl/impl/SystemUtil.java.javame_cdc_fp b/src/jogl/classes/com/jogamp/opengl/impl/SystemUtil.java.javame_cdc_fp index 91723b505..f686bea92 100644 --- a/src/jogl/classes/com/sun/opengl/impl/SystemUtil.java.javame_cdc_fp +++ b/src/jogl/classes/com/jogamp/opengl/impl/SystemUtil.java.javame_cdc_fp @@ -1,4 +1,4 @@ -package com.sun.opengl.impl; +package com.jogamp.opengl.impl; public class SystemUtil { diff --git a/src/jogl/classes/com/sun/opengl/impl/SystemUtil.java.javase b/src/jogl/classes/com/jogamp/opengl/impl/SystemUtil.java.javase index 3f201c2b6..dbb717a32 100644 --- a/src/jogl/classes/com/sun/opengl/impl/SystemUtil.java.javase +++ b/src/jogl/classes/com/jogamp/opengl/impl/SystemUtil.java.javase @@ -1,4 +1,4 @@ -package com.sun.opengl.impl; +package com.jogamp.opengl.impl; public class SystemUtil { diff --git a/src/jogl/classes/com/sun/opengl/impl/ThreadingImpl.java b/src/jogl/classes/com/jogamp/opengl/impl/ThreadingImpl.java index 4a4b2d5f9..1a68f38d4 100644 --- a/src/jogl/classes/com/sun/opengl/impl/ThreadingImpl.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/ThreadingImpl.java @@ -31,14 +31,15 @@ * */ -package com.sun.opengl.impl; +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 com.sun.nativewindow.impl.NWReflection; import javax.media.opengl.GLException; /** Implementation of the {@link javax.media.opengl.Threading} class. */ @@ -71,8 +72,8 @@ public class ThreadingImpl { // while holding the AWT lock. The optimization of // makeCurrent / release calls isn't worth these stability // problems. - hasAWT = NWReflection.isClassAvailable("java.awt.Canvas") && - NWReflection.isClassAvailable("javax.media.opengl.awt.GLCanvas"); + hasAWT = ReflectionUtil.isClassAvailable("java.awt.Canvas") && + ReflectionUtil.isClassAvailable("javax.media.opengl.awt.GLCanvas"); String osType = NativeWindowFactory.getNativeWindowType(false); _isX11 = NativeWindowFactory.TYPE_X11.equals(osType); @@ -102,8 +103,8 @@ public class ThreadingImpl { Object threadingPluginObj=null; // try to fetch the AWTThreadingPlugin try { - threadingPluginObj = NWReflection.createInstance("com.sun.opengl.impl.awt.AWTThreadingPlugin"); - } catch (Throwable t) { } + threadingPluginObj = ReflectionUtil.createInstance("com.jogamp.opengl.impl.awt.AWTThreadingPlugin"); + } catch (JogampRuntimeException jre) { /* n/a .. */ } return threadingPluginObj; } }); diff --git a/src/jogl/classes/com/sun/opengl/impl/ThreadingPlugin.java b/src/jogl/classes/com/jogamp/opengl/impl/ThreadingPlugin.java index 5c52f871e..37e4aac70 100644 --- a/src/jogl/classes/com/sun/opengl/impl/ThreadingPlugin.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/ThreadingPlugin.java @@ -37,7 +37,7 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.impl; +package com.jogamp.opengl.impl; import javax.media.opengl.*; diff --git a/src/jogl/classes/com/sun/opengl/impl/awt/AWTThreadingPlugin.java b/src/jogl/classes/com/jogamp/opengl/impl/awt/AWTThreadingPlugin.java index c7dd9ea80..07bf2f2db 100755 --- a/src/jogl/classes/com/sun/opengl/impl/awt/AWTThreadingPlugin.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/awt/AWTThreadingPlugin.java @@ -37,7 +37,7 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.impl.awt; +package com.jogamp.opengl.impl.awt; import javax.media.opengl.*; @@ -46,7 +46,7 @@ import java.awt.event.*; import java.awt.EventQueue; import java.lang.reflect.InvocationTargetException; -import com.sun.opengl.impl.*; +import com.jogamp.opengl.impl.*; public class AWTThreadingPlugin implements ThreadingPlugin { diff --git a/src/jogl/classes/com/sun/opengl/impl/awt/AWTUtil.java b/src/jogl/classes/com/jogamp/opengl/impl/awt/AWTUtil.java index f4c8944df..e5570a8ee 100644 --- a/src/jogl/classes/com/sun/opengl/impl/awt/AWTUtil.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/awt/AWTUtil.java @@ -34,11 +34,11 @@ * facility. */ -package com.sun.opengl.impl.awt; +package com.jogamp.opengl.impl.awt; -import com.sun.nativewindow.impl.jawt.*; +import com.jogamp.nativewindow.impl.jawt.*; -import com.sun.opengl.impl.*; +import com.jogamp.opengl.impl.*; import javax.media.opengl.*; @@ -58,7 +58,7 @@ public class AWTUtil { headlessMode = GraphicsEnvironment.isHeadless(); if(!headlessMode) { try { - j2dClazz = Class.forName("com.sun.opengl.impl.awt.Java2D"); + j2dClazz = Class.forName("com.jogamp.opengl.impl.awt.Java2D"); isOGLPipelineActive = j2dClazz.getMethod("isOGLPipelineActive", null); isQueueFlusherThread = j2dClazz.getMethod("isQueueFlusherThread", null); j2dOk = true; diff --git a/src/jogl/classes/com/sun/opengl/impl/awt/Java2D.java b/src/jogl/classes/com/jogamp/opengl/impl/awt/Java2D.java index 098ec8529..b871c66a7 100755 --- a/src/jogl/classes/com/sun/opengl/impl/awt/Java2D.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/awt/Java2D.java @@ -37,9 +37,9 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.impl.awt; +package com.jogamp.opengl.impl.awt; -import com.sun.opengl.impl.*; +import com.jogamp.opengl.impl.*; import java.awt.*; import java.awt.image.*; diff --git a/src/jogl/classes/com/sun/opengl/impl/awt/Java2DGLContext.java b/src/jogl/classes/com/jogamp/opengl/impl/awt/Java2DGLContext.java index 48461c116..07bc54b6a 100644 --- a/src/jogl/classes/com/sun/opengl/impl/awt/Java2DGLContext.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/awt/Java2DGLContext.java @@ -37,9 +37,9 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.impl.awt; +package com.jogamp.opengl.impl.awt; -import com.sun.opengl.impl.*; +import com.jogamp.opengl.impl.*; import java.awt.Graphics; /** Provides a construct by which the shared GLJPanel code can diff --git a/src/jogl/classes/com/sun/opengl/impl/egl/EGLContext.java b/src/jogl/classes/com/jogamp/opengl/impl/egl/EGLContext.java index 756f6afd4..48f80977c 100755 --- a/src/jogl/classes/com/sun/opengl/impl/egl/EGLContext.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/egl/EGLContext.java @@ -33,12 +33,12 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.impl.egl; +package com.jogamp.opengl.impl.egl; import javax.media.nativewindow.*; import javax.media.opengl.*; -import com.sun.opengl.impl.*; -import com.sun.gluegen.runtime.ProcAddressTable; +import com.jogamp.opengl.impl.*; +import com.jogamp.gluegen.runtime.ProcAddressTable; import java.nio.*; import java.util.*; @@ -80,13 +80,9 @@ public abstract class EGLContext extends GLContextImpl { return eglExtProcAddressTable; } - protected String mapToRealGLFunctionName(String glFunctionName) { - return glFunctionName; - } + protected Map/*<String, String>*/ getFunctionNameMap() { return null; } - protected String mapToRealGLExtensionName(String glExtensionName) { - return glExtensionName; - } + protected Map/*<String, String>*/ getExtensionNameMap() { return null; } public long getContext() { return eglContext; @@ -94,17 +90,16 @@ public abstract class EGLContext extends GLContextImpl { protected int makeCurrentImpl() throws GLException { if(EGL.EGL_NO_DISPLAY==((EGLDrawable)drawable).getDisplay() ) { - System.err.println("drawable not properly initialized"); - return CONTEXT_NOT_CURRENT; + throw new GLException("drawable not properly initialized: "+drawable); } boolean created = false; if (eglContext == 0) { create(); + created = true; if (DEBUG) { System.err.println(getThreadName() + ": !!! Created GL context 0x" + Long.toHexString(eglContext) + " for " + getClass().getName()); } - created = true; } if (EGL.eglGetCurrentContext() != eglContext) { if (!EGL.eglMakeCurrent(((EGLDrawable)drawable).getDisplay(), @@ -117,7 +112,7 @@ public abstract class EGLContext extends GLContextImpl { } if (created) { - setGLFunctionAvailability(false); + setGLFunctionAvailability(false, -1, -1, CTX_PROFILE_ES|CTX_PROFILE_CORE|CTX_OPTION_ANY); return CONTEXT_CURRENT_NEW; } return CONTEXT_CURRENT; @@ -154,17 +149,25 @@ public abstract class EGLContext extends GLContextImpl { } } + protected long createContextARBImpl(long share, boolean direct, int ctp, int major, int minor) { + return 0; // FIXME + } + + protected void destroyContextARBImpl(long _context) { + // FIXME + } + protected void create() throws GLException { long eglDisplay = ((EGLDrawable)drawable).getDisplay(); EGLGraphicsConfiguration config = ((EGLDrawable)drawable).getGraphicsConfiguration(); GLProfile glProfile = drawable.getGLProfile(); - _EGLConfig eglConfig = config.getNativeConfig(); + 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 == null) { + if (eglConfig == 0) { throw new GLException("Error: attempted to create an OpenGL context without a graphics configuration"); } @@ -219,14 +222,14 @@ public abstract class EGLContext extends GLContextImpl { throw new GLException("Error making context 0x" + Long.toHexString(eglContext) + " current: error code " + EGL.eglGetError()); } - setGLFunctionAvailability(true); + setGLFunctionAvailability(true, glProfile.usesNativeGLES2()?2:1, 0, CTX_PROFILE_ES|CTX_PROFILE_CORE|CTX_OPTION_ANY); } public boolean isCreated() { return (eglContext != 0); } - protected void updateGLProcAddressTable() { + protected void updateGLProcAddressTable(int major, int minor, int ctp) { if (DEBUG) { System.err.println(getThreadName() + ": !!! Initializing EGL extension address table"); } @@ -239,7 +242,7 @@ public abstract class EGLContext extends GLContextImpl { eglExtProcAddressTable = new EGLExtProcAddressTable(); } resetProcAddressTable(getEGLExtProcAddressTable()); - super.updateGLProcAddressTable(); + super.updateGLProcAddressTable(major, minor, ctp); } public synchronized String getPlatformExtensionsString() { diff --git a/src/jogl/classes/com/sun/opengl/impl/egl/EGLDrawable.java b/src/jogl/classes/com/jogamp/opengl/impl/egl/EGLDrawable.java index dd801e4e2..dcfe06bdc 100755 --- a/src/jogl/classes/com/sun/opengl/impl/egl/EGLDrawable.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/egl/EGLDrawable.java @@ -33,11 +33,10 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.impl.egl; +package com.jogamp.opengl.impl.egl; -import com.sun.opengl.impl.GLDrawableImpl; -import com.sun.nativewindow.impl.NWReflection; -import com.sun.gluegen.runtime.DynamicLookupHelper; +import com.jogamp.common.os.DynamicLookupHelper; +import com.jogamp.opengl.impl.GLDrawableImpl; import javax.media.nativewindow.*; import javax.media.nativewindow.egl.*; @@ -75,7 +74,7 @@ public abstract class EGLDrawable extends GLDrawableImpl { public abstract GLContext createContext(GLContext shareWith); - protected abstract long createSurface(long eglDpy, _EGLConfig eglNativeCfg, long surfaceHandle); + protected abstract long createSurface(long eglDpy, long eglNativeCfg, long surfaceHandle); private void recreateSurface() { // create a new EGLSurface .. diff --git a/src/jogl/classes/com/sun/opengl/impl/egl/EGLDrawableFactory.java b/src/jogl/classes/com/jogamp/opengl/impl/egl/EGLDrawableFactory.java index e9a622cc5..4fccf22f8 100755 --- a/src/jogl/classes/com/sun/opengl/impl/egl/EGLDrawableFactory.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/egl/EGLDrawableFactory.java @@ -33,14 +33,14 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.impl.egl; +package com.jogamp.opengl.impl.egl; -import java.util.*; import javax.media.nativewindow.*; import javax.media.opengl.*; -import com.sun.opengl.impl.*; -import com.sun.nativewindow.impl.*; -import com.sun.gluegen.runtime.NativeLibrary; +import com.jogamp.common.JogampRuntimeException; +import com.jogamp.common.util.*; +import com.jogamp.opengl.impl.*; +import com.jogamp.nativewindow.impl.NullWindow; public class EGLDrawableFactory extends GLDrawableFactoryImpl { @@ -52,8 +52,8 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl { // Check for other underlying stuff .. if(NativeWindowFactory.TYPE_X11.equals(NativeWindowFactory.getNativeWindowType(true))) { try { - NWReflection.createInstance("com.sun.opengl.impl.x11.glx.X11GLXGraphicsConfigurationFactory"); - } catch (Throwable t) {} + ReflectionUtil.createInstance("com.jogamp.opengl.impl.x11.glx.X11GLXGraphicsConfigurationFactory"); + } catch (JogampRuntimeException jre) { /* n/a .. */ } } } @@ -61,6 +61,10 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl { super(); } + + protected final GLDrawableImpl getSharedDrawable() { return null; } + protected final GLContextImpl getSharedContext() { return null; } + public GLDrawableImpl createOnscreenDrawable(NativeWindow target) { if (target == null) { throw new IllegalArgumentException("Null target"); @@ -72,7 +76,7 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl { throw new GLException("Not yet implemented"); } - public boolean canCreateGLPbuffer() { + public boolean canCreateGLPbuffer(AbstractGraphicsDevice device) { return true; } @@ -91,7 +95,7 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl { return new EGLExternalContext(absScreen); } - public boolean canCreateExternalGLDrawable() { + public boolean canCreateExternalGLDrawable(AbstractGraphicsDevice device) { return false; } @@ -102,7 +106,7 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl { public void loadGLULibrary() { } - public boolean canCreateContextOnJava2DSurface() { + public boolean canCreateContextOnJava2DSurface(AbstractGraphicsDevice device) { return false; } diff --git a/src/jogl/classes/com/sun/opengl/impl/egl/EGLDynamicLookupHelper.java b/src/jogl/classes/com/jogamp/opengl/impl/egl/EGLDynamicLookupHelper.java index 00973de89..9e34dc9e9 100755 --- a/src/jogl/classes/com/sun/opengl/impl/egl/EGLDynamicLookupHelper.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/egl/EGLDynamicLookupHelper.java @@ -33,15 +33,14 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.impl.egl; +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.sun.opengl.impl.*; -import com.sun.nativewindow.impl.*; -import com.sun.gluegen.runtime.NativeLibrary; -import com.sun.gluegen.runtime.DynamicLookupHelper; +import com.jogamp.opengl.impl.*; import java.security.*; /** @@ -51,7 +50,7 @@ import java.security.*; * Currently two implementations exist, one for ES1 and one for ES2. */ public abstract class EGLDynamicLookupHelper implements DynamicLookupHelper { - protected static final boolean DEBUG = com.sun.opengl.impl.Debug.debug("EGL"); + protected static final boolean DEBUG = com.jogamp.opengl.impl.Debug.debug("EGL"); protected static final boolean DEBUG_LOOKUP; private static final EGLDynamicLookupHelper eglES1DynamicLookupHelper; @@ -60,14 +59,14 @@ public abstract class EGLDynamicLookupHelper implements DynamicLookupHelper { static { AccessControlContext localACC=AccessController.getContext(); - DEBUG_LOOKUP = com.sun.opengl.impl.Debug.isPropertyDefined("jogl.debug.DynamicLookup", true, localACC); + DEBUG_LOOKUP = com.jogamp.opengl.impl.Debug.isPropertyDefined("jogl.debug.DynamicLookup", true, localACC); EGLDynamicLookupHelper tmp=null; try { tmp = new EGLES1DynamicLookupHelper(); - } catch (Throwable t) { + } catch (GLException gle) { if(DEBUG) { - t.printStackTrace(); + gle.printStackTrace(); } } eglES1DynamicLookupHelper = tmp; @@ -75,9 +74,9 @@ public abstract class EGLDynamicLookupHelper implements DynamicLookupHelper { tmp=null; try { tmp = new EGLES2DynamicLookupHelper(); - } catch (Throwable t) { + } catch (GLException gle) { if(DEBUG) { - t.printStackTrace(); + gle.printStackTrace(); } } eglES2DynamicLookupHelper = tmp; @@ -192,9 +191,9 @@ public abstract class EGLDynamicLookupHelper implements DynamicLookupHelper { } if (esProfile==2) { - NativeLibLoader.loadES2(); + GLJNILibLoader.loadES2(); } else if (esProfile==1) { - NativeLibLoader.loadES1(); + GLJNILibLoader.loadES1(); } else { throw new GLException("Unsupported: ES"+esProfile); } @@ -226,7 +225,7 @@ public abstract class EGLDynamicLookupHelper implements DynamicLookupHelper { // Look up this function name in all known libraries for (Iterator iter = glesLibraries.iterator(); iter.hasNext(); ) { NativeLibrary lib = (NativeLibrary) iter.next(); - long addr = lib.lookupFunction(glFuncName); + long addr = lib.dynamicLookupFunction(glFuncName); if (addr != 0) { return addr; } diff --git a/src/jogl/classes/com/sun/opengl/impl/egl/EGLES1DynamicLookupHelper.java b/src/jogl/classes/com/jogamp/opengl/impl/egl/EGLES1DynamicLookupHelper.java index 7e60e25c0..e5740a4f0 100755 --- a/src/jogl/classes/com/sun/opengl/impl/egl/EGLES1DynamicLookupHelper.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/egl/EGLES1DynamicLookupHelper.java @@ -33,14 +33,9 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.impl.egl; +package com.jogamp.opengl.impl.egl; import java.util.*; -import javax.media.nativewindow.*; -import javax.media.opengl.*; -import com.sun.opengl.impl.*; -import com.sun.nativewindow.impl.*; -import com.sun.gluegen.runtime.NativeLibrary; /** * Implementation of the EGLDynamicLookupHelper for ES1. diff --git a/src/jogl/classes/com/sun/opengl/impl/egl/EGLES2DynamicLookupHelper.java b/src/jogl/classes/com/jogamp/opengl/impl/egl/EGLES2DynamicLookupHelper.java index cfd0558c9..c4fc66630 100755 --- a/src/jogl/classes/com/sun/opengl/impl/egl/EGLES2DynamicLookupHelper.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/egl/EGLES2DynamicLookupHelper.java @@ -33,14 +33,9 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.impl.egl; +package com.jogamp.opengl.impl.egl; import java.util.*; -import javax.media.nativewindow.*; -import javax.media.opengl.*; -import com.sun.opengl.impl.*; -import com.sun.nativewindow.impl.*; -import com.sun.gluegen.runtime.NativeLibrary; /** * Implementation of the EGLDynamicLookupHelper for ES2. diff --git a/src/jogl/classes/com/sun/opengl/impl/egl/EGLExternalContext.java b/src/jogl/classes/com/jogamp/opengl/impl/egl/EGLExternalContext.java index 86c82396e..5a8454ea7 100755 --- a/src/jogl/classes/com/sun/opengl/impl/egl/EGLExternalContext.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/egl/EGLExternalContext.java @@ -33,10 +33,10 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.impl.egl; +package com.jogamp.opengl.impl.egl; import javax.media.opengl.*; -import com.sun.opengl.impl.*; +import com.jogamp.opengl.impl.*; import javax.media.nativewindow.*; public class EGLExternalContext extends EGLContext { @@ -47,7 +47,7 @@ public class EGLExternalContext extends EGLContext { public EGLExternalContext(AbstractGraphicsScreen screen) { super(null, null); GLContextShareSet.contextCreated(this); - setGLFunctionAvailability(false); + setGLFunctionAvailability(false, 0, 0, CTX_IS_ARB_CREATED|CTX_PROFILE_ES|CTX_PROFILE_CORE|CTX_OPTION_ANY); getGLStateTracker().setEnabled(false); // external context usage can't track state in Java } diff --git a/src/jogl/classes/com/sun/opengl/impl/egl/EGLGraphicsConfiguration.java b/src/jogl/classes/com/jogamp/opengl/impl/egl/EGLGraphicsConfiguration.java index 5ab3c3ed5..2d5154442 100644 --- a/src/jogl/classes/com/sun/opengl/impl/egl/EGLGraphicsConfiguration.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/egl/EGLGraphicsConfiguration.java @@ -33,20 +33,20 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.impl.egl; +package com.jogamp.opengl.impl.egl; +import com.jogamp.common.nio.PointerBuffer; import java.util.*; import javax.media.nativewindow.*; import javax.media.nativewindow.egl.*; import javax.media.opengl.*; -import com.sun.opengl.impl.*; -import com.sun.gluegen.runtime.NativeLibrary; +import com.jogamp.opengl.impl.*; public class EGLGraphicsConfiguration extends DefaultGraphicsConfiguration implements Cloneable { protected static final boolean DEBUG = Debug.debug("GraphicsConfiguration"); - public _EGLConfig getNativeConfig() { - return _config; + public long getNativeConfig() { + return config; } public int getNativeConfigID() { @@ -55,10 +55,10 @@ public class EGLGraphicsConfiguration extends DefaultGraphicsConfiguration imple public EGLGraphicsConfiguration(AbstractGraphicsScreen absScreen, GLCapabilities capsChosen, GLCapabilities capsRequested, GLCapabilitiesChooser chooser, - _EGLConfig cfg, int cfgID) { + long cfg, int cfgID) { super(absScreen, capsChosen, capsRequested); this.chooser = chooser; - _config = cfg; + config = cfg; configID = cfgID; } @@ -72,9 +72,9 @@ public class EGLGraphicsConfiguration extends DefaultGraphicsConfiguration imple throw new GLException("Invalid EGL display: "+absDevice); } GLProfile glp = capsRequested.getGLProfile(); - _EGLConfig _cfg = EGLConfigId2EGLConfig(glp, dpy, cfgID); - GLCapabilities caps = EGLConfig2Capabilities(glp, dpy, _cfg, false, capsRequested.isOnscreen(), capsRequested.isPBuffer()); - return new EGLGraphicsConfiguration(absScreen, caps, capsRequested, new DefaultGLCapabilitiesChooser(), _cfg, cfgID); + long cfg = EGLConfigId2EGLConfig(glp, dpy, cfgID); + GLCapabilities caps = EGLConfig2Capabilities(glp, dpy, cfg, false, capsRequested.isOnscreen(), capsRequested.isPBuffer()); + return new EGLGraphicsConfiguration(absScreen, caps, capsRequested, new DefaultGLCapabilitiesChooser(), cfg, cfgID); } public Object clone() { @@ -89,7 +89,7 @@ public class EGLGraphicsConfiguration extends DefaultGraphicsConfiguration imple if(null!=newConfig) { // FIXME: setScreen( ... ); setChosenCapabilities(newConfig.getChosenCapabilities()); - _config = newConfig.getNativeConfig(); + config = newConfig.getNativeConfig(); configID = newConfig.getNativeConfigID(); if(DEBUG) { System.err.println("!!! updateGraphicsConfiguration: "+this); @@ -97,23 +97,23 @@ public class EGLGraphicsConfiguration extends DefaultGraphicsConfiguration imple } } - public static _EGLConfig EGLConfigId2EGLConfig(GLProfile glp, long display, int configID) { + public static long EGLConfigId2EGLConfig(GLProfile glp, long display, int configID) { int[] attrs = new int[] { EGL.EGL_CONFIG_ID, configID, EGL.EGL_NONE }; - _EGLConfig[] configs = new _EGLConfig[1]; + PointerBuffer configs = PointerBuffer.allocateDirect(1); int[] numConfigs = new int[1]; if (!EGL.eglChooseConfig(display, attrs, 0, configs, 1, numConfigs, 0)) { - return null; + return 0; } if (numConfigs[0] == 0) { - return null; + return 0; } - return configs[0]; + return configs.get(0); } public static boolean EGLConfigDrawableTypeVerify(int val, boolean onscreen, boolean usePBuffer) { @@ -122,62 +122,63 @@ public class EGLGraphicsConfiguration extends DefaultGraphicsConfiguration imple if ( onscreen ) { res = ( 0 != (val & EGL.EGL_WINDOW_BIT) ) ; } else { - res = ( 0 != (val & EGL.EGL_PIXMAP_BIT) ) || usePBuffer ; - } - if ( usePBuffer ) { - res = res && ( 0 != (val & EGL.EGL_PBUFFER_BIT) ) ; + if ( usePBuffer ) { + res = ( 0 != (val & EGL.EGL_PBUFFER_BIT) ) ; + } else { + res = ( 0 != (val & EGL.EGL_PIXMAP_BIT) ) ; + } } return res; } - public static GLCapabilities EGLConfig2Capabilities(GLProfile glp, long display, _EGLConfig _config, + public static GLCapabilities 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)) { + 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)) { + 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)) { + 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)) { + 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)) { + 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)) { + 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)) { + 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)) { + 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)) { + 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)) { + 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)) { + 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)) { + 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(EGL.eglGetConfigAttrib(display, config, EGL.EGL_SURFACE_TYPE, val, 0)) { if(EGLConfigDrawableTypeVerify(val[0], onscreen, usePBuffer)) { caps.setDoubleBuffered(onscreen); caps.setOnscreen(onscreen); @@ -187,17 +188,13 @@ public class EGLGraphicsConfiguration extends DefaultGraphicsConfiguration imple caps.setOnscreen( 0 != (val[0] & EGL.EGL_WINDOW_BIT) ); caps.setPBuffer ( 0 != (val[0] & EGL.EGL_PBUFFER_BIT) ); } else { - throw new GLException("EGL_SURFACE_TYPE does not match !!!"); - } - } else { - if(relaxed) { if(DEBUG) { - System.err.println("Could not determine EGL_SURFACE_TYPE !!!"); + 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 !!!"); } + } else { + throw new GLException("Could not determine EGL_SURFACE_TYPE !!!"); } return caps; @@ -300,7 +297,7 @@ public class EGLGraphicsConfiguration extends DefaultGraphicsConfiguration imple } private GLCapabilitiesChooser chooser; - private _EGLConfig _config; + private long config; private int configID; } diff --git a/src/jogl/classes/com/sun/opengl/impl/egl/EGLGraphicsConfigurationFactory.java b/src/jogl/classes/com/jogamp/opengl/impl/egl/EGLGraphicsConfigurationFactory.java index 3997850c0..33e301ee9 100644 --- a/src/jogl/classes/com/sun/opengl/impl/egl/EGLGraphicsConfigurationFactory.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/egl/EGLGraphicsConfigurationFactory.java @@ -30,15 +30,15 @@ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ -package com.sun.opengl.impl.egl; +package com.jogamp.opengl.impl.egl; +import com.jogamp.common.nio.PointerBuffer; import java.io.PrintStream; import javax.media.nativewindow.*; import javax.media.nativewindow.egl.*; -import com.sun.nativewindow.impl.*; import javax.media.opengl.*; -import com.sun.opengl.impl.*; + /** Subclass of GraphicsConfigurationFactory used when non-AWT tookits are used on X11 platforms. Toolkits will likely need to delegate @@ -46,7 +46,7 @@ import com.sun.opengl.impl.*; GraphicsDevice and GraphicsConfiguration abstractions. */ public class EGLGraphicsConfigurationFactory extends GraphicsConfigurationFactory { - protected static final boolean DEBUG = GraphicsConfigurationFactory.DEBUG || com.sun.opengl.impl.Debug.debug("EGL"); + protected static final boolean DEBUG = GraphicsConfigurationFactory.DEBUG || com.jogamp.opengl.impl.Debug.debug("EGL"); public EGLGraphicsConfigurationFactory() { // become the selector for KD/EGL .. @@ -99,7 +99,7 @@ public class EGLGraphicsConfigurationFactory extends GraphicsConfigurationFactor GLCapabilities caps2 = (GLCapabilities) capabilities.clone(); if(!caps2.isOnscreen()) { - // OFFSCREEN !DOUBLE_BUFFER + // OFFSCREEN !DOUBLE_BUFFER // FIXME DBLBUFOFFSCRN caps2.setDoubleBuffered(false); } @@ -115,10 +115,10 @@ public class EGLGraphicsConfigurationFactory extends GraphicsConfigurationFactor chooser = new DefaultGLCapabilitiesChooser(); } - _EGLConfig[] configs = new _EGLConfig[10]; + PointerBuffer configs = PointerBuffer.allocateDirect(10); int[] numConfigs = new int[1]; - if(!EGL.eglGetConfigs(eglDisplay, configs, configs.length, numConfigs, 0)) { + if(!EGL.eglGetConfigs(eglDisplay, configs, configs.capacity(), numConfigs, 0)) { throw new GLException("Graphics configuration fetch (eglGetConfigs) failed"); } if (numConfigs[0] == 0) { @@ -205,11 +205,11 @@ public class EGLGraphicsConfigurationFactory extends GraphicsConfigurationFactor AbstractGraphicsScreen absScreen) { GLProfile glp = capsChosen0.getGLProfile(); int[] attrs = EGLGraphicsConfiguration.GLCapabilities2AttribList(capsChosen0); - _EGLConfig[] configs = new _EGLConfig[1]; + PointerBuffer configs = PointerBuffer.allocateDirect(1); int[] numConfigs = new int[1]; if (!EGL.eglChooseConfig(eglDisplay, attrs, 0, - configs, configs.length, + configs, configs.capacity(), numConfigs, 0)) { throw new GLException("Graphics configuration selection (eglChooseConfig) failed for "+capsChosen0); } @@ -222,14 +222,14 @@ public class EGLGraphicsConfigurationFactory extends GraphicsConfigurationFactor } int[] val = new int[1]; // get the configID - if(!EGL.eglGetConfigAttrib(eglDisplay, configs[0], EGL.EGL_CONFIG_ID, val, 0)) { + 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; } - GLCapabilities capsChosen1 = EGLGraphicsConfiguration.EGLConfig2Capabilities(glp, eglDisplay, configs[0], + GLCapabilities capsChosen1 = EGLGraphicsConfiguration.EGLConfig2Capabilities(glp, eglDisplay, configs.get(0), true, capsChosen0.isOnscreen(), capsChosen0.isPBuffer()); if(null!=capsChosen1) { if(DEBUG) { @@ -237,7 +237,7 @@ public class EGLGraphicsConfigurationFactory extends GraphicsConfigurationFactor ", eglConfig ID 0x"+Integer.toHexString(val[0])+ ", "+capsChosen0+" -> "+capsChosen1); } - return new EGLGraphicsConfiguration(absScreen, capsChosen1, capsRequested, chooser, configs[0], val[0]); + 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)+ @@ -253,11 +253,11 @@ public class EGLGraphicsConfigurationFactory extends GraphicsConfigurationFactor return null; } - protected static GLCapabilities[] eglConfigs2GLCaps(GLProfile glp, long eglDisplay, _EGLConfig[] configs, int num, + protected static GLCapabilities[] eglConfigs2GLCaps(GLProfile glp, long eglDisplay, PointerBuffer configs, int num, boolean onscreen, boolean usePBuffer) { GLCapabilities[] caps = new GLCapabilities[num]; for(int i=0; i<num; i++) { - caps[i] = EGLGraphicsConfiguration.EGLConfig2Capabilities(glp, eglDisplay, configs[i], + caps[i] = EGLGraphicsConfiguration.EGLConfig2Capabilities(glp, eglDisplay, configs.get(i), true, onscreen, usePBuffer); } return caps; @@ -273,7 +273,7 @@ public class EGLGraphicsConfigurationFactory extends GraphicsConfigurationFactor if(caps.isOnscreen()) { throw new GLException("Error: Onscreen set: "+caps); } - caps.setDoubleBuffered(false); // FIXME + caps.setDoubleBuffered(false); // FIXME DBLBUFOFFSCRN 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())); diff --git a/src/jogl/classes/com/sun/opengl/impl/egl/EGLOnscreenContext.java b/src/jogl/classes/com/jogamp/opengl/impl/egl/EGLOnscreenContext.java index c1a5bd583..b74991671 100755 --- a/src/jogl/classes/com/sun/opengl/impl/egl/EGLOnscreenContext.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/egl/EGLOnscreenContext.java @@ -33,12 +33,12 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.impl.egl; +package com.jogamp.opengl.impl.egl; import javax.media.nativewindow.*; import javax.media.opengl.*; -import com.sun.opengl.impl.*; -import com.sun.gluegen.runtime.ProcAddressTable; +import com.jogamp.opengl.impl.*; +import com.jogamp.gluegen.runtime.ProcAddressTable; import java.nio.*; import java.util.*; diff --git a/src/jogl/classes/com/sun/opengl/impl/egl/EGLOnscreenDrawable.java b/src/jogl/classes/com/jogamp/opengl/impl/egl/EGLOnscreenDrawable.java index 45fffbc91..3864fc39c 100644 --- a/src/jogl/classes/com/sun/opengl/impl/egl/EGLOnscreenDrawable.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/egl/EGLOnscreenDrawable.java @@ -37,13 +37,13 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.impl.egl; +package com.jogamp.opengl.impl.egl; import javax.media.opengl.*; import javax.media.nativewindow.*; import javax.media.nativewindow.egl.*; -import com.sun.opengl.impl.*; -import com.sun.nativewindow.impl.NullWindow; +import com.jogamp.opengl.impl.*; +import com.jogamp.nativewindow.impl.NullWindow; public class EGLOnscreenDrawable extends EGLDrawable { protected EGLOnscreenDrawable(EGLDrawableFactory factory, NativeWindow component) throws GLException { @@ -54,27 +54,25 @@ public class EGLOnscreenDrawable extends EGLDrawable { return new EGLOnscreenContext(this, shareWith); } - protected long createSurface(long eglDpy, _EGLConfig eglNativeCfg, long surfaceHandle) { + protected long createSurface(long eglDpy, long eglNativeCfg, long surfaceHandle) { return EGL.eglCreateWindowSurface(eglDpy, eglNativeCfg, surfaceHandle, null); } protected void swapBuffersImpl() { boolean didLock = false; + if (!isSurfaceLocked()) { + // Usually the surface shall be locked within [makeCurrent .. swap .. release] + if (lockSurface() == NativeWindow.LOCK_SURFACE_NOT_READY) { + return; + } + didLock = true; + } try { - if ( !isSurfaceLocked() ) { - // Usually the surface shall be locked within [makeCurrent .. swap .. release] - if (lockSurface() == NativeWindow.LOCK_SURFACE_NOT_READY) { - return; - } - didLock = true; - } - - EGL.eglSwapBuffers(eglDisplay, eglSurface); - + EGL.eglSwapBuffers(eglDisplay, eglSurface); } finally { - if(didLock) { - unlockSurface(); - } + if (didLock) { + unlockSurface(); + } } } diff --git a/src/jogl/classes/com/sun/opengl/impl/egl/EGLPbufferContext.java b/src/jogl/classes/com/jogamp/opengl/impl/egl/EGLPbufferContext.java index 2a7a7705c..5c634b9bd 100755 --- a/src/jogl/classes/com/sun/opengl/impl/egl/EGLPbufferContext.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/egl/EGLPbufferContext.java @@ -33,12 +33,12 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.impl.egl; +package com.jogamp.opengl.impl.egl; import javax.media.nativewindow.*; import javax.media.opengl.*; -import com.sun.opengl.impl.*; -import com.sun.gluegen.runtime.ProcAddressTable; +import com.jogamp.opengl.impl.*; +import com.jogamp.gluegen.runtime.ProcAddressTable; import java.nio.*; import java.util.*; diff --git a/src/jogl/classes/com/sun/opengl/impl/egl/EGLPbufferDrawable.java b/src/jogl/classes/com/jogamp/opengl/impl/egl/EGLPbufferDrawable.java index e16420b3a..03b02b77e 100644 --- a/src/jogl/classes/com/sun/opengl/impl/egl/EGLPbufferDrawable.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/egl/EGLPbufferDrawable.java @@ -37,12 +37,12 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.impl.egl; +package com.jogamp.opengl.impl.egl; import javax.media.opengl.*; import javax.media.nativewindow.*; import javax.media.nativewindow.egl.*; -import com.sun.opengl.impl.*; +import com.jogamp.opengl.impl.*; public class EGLPbufferDrawable extends EGLDrawable { private int texFormat; @@ -73,7 +73,7 @@ public class EGLPbufferDrawable extends EGLDrawable { } - protected long createSurface(long eglDpy, _EGLConfig eglNativeCfg, long surfaceHandle) { + protected long createSurface(long eglDpy, long eglNativeCfg, long surfaceHandle) { NativeWindow nw = getNativeWindow(); int[] attrs = EGLGraphicsConfiguration.CreatePBufferSurfaceAttribList(nw.getWidth(), nw.getHeight(), texFormat); long surf = EGL.eglCreatePbufferSurface(eglDpy, eglNativeCfg, attrs, 0); diff --git a/src/jogl/classes/com/sun/opengl/impl/gl2/ProjectDouble.java b/src/jogl/classes/com/jogamp/opengl/impl/gl2/ProjectDouble.java index 5b7b679ad..2eb3ca5df 100755 --- a/src/jogl/classes/com/sun/opengl/impl/gl2/ProjectDouble.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/gl2/ProjectDouble.java @@ -1,7 +1,7 @@ /* ** 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 1.1 (the "License"), the contents of this +** 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 @@ -112,12 +112,12 @@ * in the design, construction, operation or maintenance of any nuclear * facility. */ -package com.sun.opengl.impl.gl2; +package com.jogamp.opengl.impl.gl2; import java.nio.*; import javax.media.opengl.*; -import com.sun.opengl.impl.*; +import com.jogamp.opengl.impl.*; /** * Project.java diff --git a/src/jogl/classes/com/sun/opengl/impl/gl2/Util.java b/src/jogl/classes/com/jogamp/opengl/impl/gl2/Util.java index 0fc72daa9..a542dcf19 100644 --- a/src/jogl/classes/com/sun/opengl/impl/gl2/Util.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/gl2/Util.java @@ -66,9 +66,9 @@ * facility. */ -package com.sun.opengl.impl.gl2; +package com.jogamp.opengl.impl.gl2; -import com.sun.opengl.impl.*; +import com.jogamp.opengl.impl.*; import java.nio.IntBuffer; import javax.media.opengl.*; diff --git a/src/jogl/classes/com/sun/opengl/impl/gl2/fixme/GLObjectTracker.java b/src/jogl/classes/com/jogamp/opengl/impl/gl2/fixme/GLObjectTracker.java index 885f3cb28..3e3b6ae87 100755 --- a/src/jogl/classes/com/sun/opengl/impl/gl2/fixme/GLObjectTracker.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/gl2/fixme/GLObjectTracker.java @@ -37,9 +37,9 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.impl.gl2; +package com.jogamp.opengl.impl.gl2; -import com.sun.opengl.impl.*; +import com.jogamp.opengl.impl.*; import java.nio.*; import javax.media.opengl.*; diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/GLUquadricImpl.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/GLUquadricImpl.java index 34b5ced6b..d7e6a23c1 100644 --- a/src/jogl/classes/com/sun/opengl/impl/glu/GLUquadricImpl.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/glu/GLUquadricImpl.java @@ -1,7 +1,7 @@ /* ** 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 1.1 (the "License"), the contents of this +** 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 @@ -113,11 +113,11 @@ * facility. */ -package com.sun.opengl.impl.glu; +package com.jogamp.opengl.impl.glu; import javax.media.opengl.*; import javax.media.opengl.glu.*; -import com.sun.opengl.util.ImmModeSink; +import com.jogamp.opengl.util.ImmModeSink; import java.nio.*; /** diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/Glue.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/Glue.java index ada5ab684..7c360c574 100755 --- a/src/jogl/classes/com/sun/opengl/impl/glu/Glue.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/glu/Glue.java @@ -1,7 +1,7 @@ /* * 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 1.1 (the "License"), the contents of this + * 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 @@ -42,7 +42,7 @@ * compliant with the OpenGL(R) version 1.2.1 Specification. */ -package com.sun.opengl.impl.glu; +package com.jogamp.opengl.impl.glu; /** * diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/error/Error.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/error/Error.java index d24a41f10..7c7e6b0d8 100644 --- a/src/jogl/classes/com/sun/opengl/impl/glu/error/Error.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/glu/error/Error.java @@ -1,7 +1,7 @@ /* * 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 1.1 (the "License"), the contents of this + * 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 @@ -42,11 +42,11 @@ * compliant with the OpenGL(R) version 1.2.1 Specification. */ -package com.sun.opengl.impl.glu.error; +package com.jogamp.opengl.impl.glu.error; import javax.media.opengl.GL; import javax.media.opengl.glu.GLU; -import com.sun.opengl.impl.glu.Glue; +import com.jogamp.opengl.impl.glu.Glue; /** * diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/gl2/nurbs/GL2Backend.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/gl2/nurbs/GL2Backend.java index d54f1c56f..42ddeea50 100755 --- a/src/jogl/classes/com/sun/opengl/impl/glu/gl2/nurbs/GL2Backend.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/glu/gl2/nurbs/GL2Backend.java @@ -1,10 +1,10 @@ -package com.sun.opengl.impl.glu.gl2.nurbs; -import com.sun.opengl.impl.glu.nurbs.*; +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 1.1 (the "License"), the contents of this + ** 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 diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/gl2/nurbs/GL2CurveEvaluator.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/gl2/nurbs/GL2CurveEvaluator.java index 5be4f9049..adb8c51d8 100755 --- a/src/jogl/classes/com/sun/opengl/impl/glu/gl2/nurbs/GL2CurveEvaluator.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/glu/gl2/nurbs/GL2CurveEvaluator.java @@ -1,10 +1,10 @@ -package com.sun.opengl.impl.glu.gl2.nurbs; -import com.sun.opengl.impl.glu.nurbs.*; +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 1.1 (the "License"), the contents of this + ** 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 diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/gl2/nurbs/GL2SurfaceEvaluator.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/gl2/nurbs/GL2SurfaceEvaluator.java index c226b7db9..393601ff7 100755 --- a/src/jogl/classes/com/sun/opengl/impl/glu/gl2/nurbs/GL2SurfaceEvaluator.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/glu/gl2/nurbs/GL2SurfaceEvaluator.java @@ -1,10 +1,10 @@ -package com.sun.opengl.impl.glu.gl2.nurbs; -import com.sun.opengl.impl.glu.nurbs.*; +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 1.1 (the "License"), the contents of this + ** 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 diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/gl2/nurbs/GLUgl2nurbsImpl.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/gl2/nurbs/GLUgl2nurbsImpl.java index d6c653a73..13b68138c 100755 --- a/src/jogl/classes/com/sun/opengl/impl/glu/gl2/nurbs/GLUgl2nurbsImpl.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/glu/gl2/nurbs/GLUgl2nurbsImpl.java @@ -1,10 +1,10 @@ -package com.sun.opengl.impl.glu.gl2.nurbs; -import com.sun.opengl.impl.glu.nurbs.*; +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 1.1 (the "License"), the contents of this + ** 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 diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/BuildMipmap.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/BuildMipmap.java index f77f76fc8..501f5f585 100644 --- a/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/BuildMipmap.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/BuildMipmap.java @@ -1,7 +1,7 @@ /* * 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 1.1 (the "License"), the contents of this + * 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 @@ -42,13 +42,13 @@ * compliant with the OpenGL(R) version 1.2.1 Specification. */ -package com.sun.opengl.impl.glu.mipmap; +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.sun.opengl.impl.Debug; -import com.sun.opengl.impl.InternalBufferUtil; +import com.jogamp.opengl.impl.Debug; +import com.jogamp.opengl.impl.InternalBufferUtil; import java.nio.*; import java.io.*; diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Extract.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/Extract.java index d5224af74..be86585e7 100644 --- a/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Extract.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/Extract.java @@ -1,7 +1,7 @@ /* * 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 1.1 (the "License"), the contents of this + * 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 @@ -42,7 +42,7 @@ * compliant with the OpenGL(R) version 1.2.1 Specification. */ -package com.sun.opengl.impl.glu.mipmap; +package com.jogamp.opengl.impl.glu.mipmap; import java.nio.ByteBuffer; diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Extract1010102.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/Extract1010102.java index fc29b299b..7e172b1ce 100644 --- a/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Extract1010102.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/Extract1010102.java @@ -1,7 +1,7 @@ /* * 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 1.1 (the "License"), the contents of this + * 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 @@ -42,7 +42,7 @@ * compliant with the OpenGL(R) version 1.2.1 Specification. */ -package com.sun.opengl.impl.glu.mipmap; +package com.jogamp.opengl.impl.glu.mipmap; import java.nio.ByteBuffer; diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Extract1555rev.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/Extract1555rev.java index e1c59041a..37895096e 100644 --- a/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Extract1555rev.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/Extract1555rev.java @@ -1,7 +1,7 @@ /* * 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 1.1 (the "License"), the contents of this + * 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 @@ -42,7 +42,7 @@ * compliant with the OpenGL(R) version 1.2.1 Specification. */ -package com.sun.opengl.impl.glu.mipmap; +package com.jogamp.opengl.impl.glu.mipmap; import java.nio.ByteBuffer; diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Extract2101010rev.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/Extract2101010rev.java index e04d948d8..077f3037b 100644 --- a/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Extract2101010rev.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/Extract2101010rev.java @@ -1,7 +1,7 @@ /* * 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 1.1 (the "License"), the contents of this + * 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 @@ -42,7 +42,7 @@ * compliant with the OpenGL(R) version 1.2.1 Specification. */ -package com.sun.opengl.impl.glu.mipmap; +package com.jogamp.opengl.impl.glu.mipmap; import java.nio.ByteBuffer; diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Extract233rev.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/Extract233rev.java index a3d8ce2a8..fa35c6fbc 100644 --- a/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Extract233rev.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/Extract233rev.java @@ -1,7 +1,7 @@ /* * 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 1.1 (the "License"), the contents of this + * 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 @@ -42,7 +42,7 @@ * compliant with the OpenGL(R) version 1.2.1 Specification. */ -package com.sun.opengl.impl.glu.mipmap; +package com.jogamp.opengl.impl.glu.mipmap; import java.nio.ByteBuffer; diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Extract332.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/Extract332.java index 008911364..35936466c 100644 --- a/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Extract332.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/Extract332.java @@ -1,7 +1,7 @@ /* * 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 1.1 (the "License"), the contents of this + * 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 @@ -42,7 +42,7 @@ * compliant with the OpenGL(R) version 1.2.1 Specification. */ -package com.sun.opengl.impl.glu.mipmap; +package com.jogamp.opengl.impl.glu.mipmap; import java.nio.ByteBuffer; diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Extract4444.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/Extract4444.java index b7414b184..bac4f57aa 100644 --- a/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Extract4444.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/Extract4444.java @@ -1,7 +1,7 @@ /* * 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 1.1 (the "License"), the contents of this + * 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 @@ -42,7 +42,7 @@ * compliant with the OpenGL(R) version 1.2.1 Specification. */ -package com.sun.opengl.impl.glu.mipmap; +package com.jogamp.opengl.impl.glu.mipmap; import java.nio.*; diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Extract4444rev.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/Extract4444rev.java index 30a2fa1ac..b1bea75e1 100644 --- a/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Extract4444rev.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/Extract4444rev.java @@ -1,7 +1,7 @@ /* * 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 1.1 (the "License"), the contents of this + * 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 @@ -42,7 +42,7 @@ * compliant with the OpenGL(R) version 1.2.1 Specification. */ -package com.sun.opengl.impl.glu.mipmap; +package com.jogamp.opengl.impl.glu.mipmap; import java.nio.*; diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Extract5551.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/Extract5551.java index f9e692e98..a6247844f 100644 --- a/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Extract5551.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/Extract5551.java @@ -1,7 +1,7 @@ /* * 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 1.1 (the "License"), the contents of this + * 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 @@ -42,7 +42,7 @@ * compliant with the OpenGL(R) version 1.2.1 Specification. */ -package com.sun.opengl.impl.glu.mipmap; +package com.jogamp.opengl.impl.glu.mipmap; import java.nio.*; diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Extract565.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/Extract565.java index 5eff68d7e..624a4f3f2 100644 --- a/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Extract565.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/Extract565.java @@ -1,7 +1,7 @@ /* * 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 1.1 (the "License"), the contents of this + * 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 @@ -42,7 +42,7 @@ * compliant with the OpenGL(R) version 1.2.1 Specification. */ -package com.sun.opengl.impl.glu.mipmap; +package com.jogamp.opengl.impl.glu.mipmap; import java.nio.*; diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Extract565rev.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/Extract565rev.java index 099f80be5..4ab6d7e98 100644 --- a/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Extract565rev.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/Extract565rev.java @@ -1,7 +1,7 @@ /* * 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 1.1 (the "License"), the contents of this + * 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 @@ -42,7 +42,7 @@ * compliant with the OpenGL(R) version 1.2.1 Specification. */ -package com.sun.opengl.impl.glu.mipmap; +package com.jogamp.opengl.impl.glu.mipmap; import java.nio.*; diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Extract8888.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/Extract8888.java index f3da73952..90d7e57c9 100644 --- a/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Extract8888.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/Extract8888.java @@ -1,7 +1,7 @@ /* * 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 1.1 (the "License"), the contents of this + * 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 @@ -42,7 +42,7 @@ * compliant with the OpenGL(R) version 1.2.1 Specification. */ -package com.sun.opengl.impl.glu.mipmap; +package com.jogamp.opengl.impl.glu.mipmap; import java.nio.*; diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Extract8888rev.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/Extract8888rev.java index 58dbe81f8..10970573b 100644 --- a/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Extract8888rev.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/Extract8888rev.java @@ -1,7 +1,7 @@ /* * 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 1.1 (the "License"), the contents of this + * 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 @@ -42,7 +42,7 @@ * compliant with the OpenGL(R) version 1.2.1 Specification. */ -package com.sun.opengl.impl.glu.mipmap; +package com.jogamp.opengl.impl.glu.mipmap; import java.nio.*; diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/ExtractFloat.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/ExtractFloat.java index 7d06dfa82..c42799470 100644 --- a/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/ExtractFloat.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/ExtractFloat.java @@ -1,7 +1,7 @@ /* * 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 1.1 (the "License"), the contents of this + * 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 @@ -42,7 +42,7 @@ * compliant with the OpenGL(R) version 1.2.1 Specification. */ -package com.sun.opengl.impl.glu.mipmap; +package com.jogamp.opengl.impl.glu.mipmap; import java.nio.*; diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/ExtractPrimitive.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/ExtractPrimitive.java index 4cea1aa39..8b986d6d0 100644 --- a/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/ExtractPrimitive.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/ExtractPrimitive.java @@ -1,7 +1,7 @@ /* * 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 1.1 (the "License"), the contents of this + * 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 @@ -42,7 +42,7 @@ * compliant with the OpenGL(R) version 1.2.1 Specification. */ -package com.sun.opengl.impl.glu.mipmap; +package com.jogamp.opengl.impl.glu.mipmap; import java.nio.ByteBuffer; diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/ExtractSByte.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/ExtractSByte.java index a2cfeca94..4f61015f4 100644 --- a/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/ExtractSByte.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/ExtractSByte.java @@ -1,7 +1,7 @@ /* * 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 1.1 (the "License"), the contents of this + * 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 @@ -42,7 +42,7 @@ * compliant with the OpenGL(R) version 1.2.1 Specification. */ -package com.sun.opengl.impl.glu.mipmap; +package com.jogamp.opengl.impl.glu.mipmap; import java.nio.ByteBuffer; diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/ExtractSInt.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/ExtractSInt.java index 48becdc18..2d5ac5329 100644 --- a/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/ExtractSInt.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/ExtractSInt.java @@ -1,7 +1,7 @@ /* * 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 1.1 (the "License"), the contents of this + * 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 @@ -42,7 +42,7 @@ * compliant with the OpenGL(R) version 1.2.1 Specification. */ -package com.sun.opengl.impl.glu.mipmap; +package com.jogamp.opengl.impl.glu.mipmap; import java.nio.*; diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/ExtractSShort.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/ExtractSShort.java index 00ff15119..8b8d50cbf 100644 --- a/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/ExtractSShort.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/ExtractSShort.java @@ -1,7 +1,7 @@ /* * 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 1.1 (the "License"), the contents of this + * 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 @@ -42,7 +42,7 @@ * compliant with the OpenGL(R) version 1.2.1 Specification. */ -package com.sun.opengl.impl.glu.mipmap; +package com.jogamp.opengl.impl.glu.mipmap; import java.nio.*; diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/ExtractUByte.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/ExtractUByte.java index 4767d93c0..d33213f89 100644 --- a/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/ExtractUByte.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/ExtractUByte.java @@ -1,7 +1,7 @@ /* * 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 1.1 (the "License"), the contents of this + * 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 @@ -42,7 +42,7 @@ * compliant with the OpenGL(R) version 1.2.1 Specification. */ -package com.sun.opengl.impl.glu.mipmap; +package com.jogamp.opengl.impl.glu.mipmap; import java.nio.ByteBuffer; diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/ExtractUInt.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/ExtractUInt.java index e6cd6e183..873668a43 100644 --- a/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/ExtractUInt.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/ExtractUInt.java @@ -1,7 +1,7 @@ /* * 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 1.1 (the "License"), the contents of this + * 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 @@ -42,7 +42,7 @@ * compliant with the OpenGL(R) version 1.2.1 Specification. */ -package com.sun.opengl.impl.glu.mipmap; +package com.jogamp.opengl.impl.glu.mipmap; import java.nio.*; diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/ExtractUShort.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/ExtractUShort.java index 89b42e41b..86bbb95f1 100644 --- a/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/ExtractUShort.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/ExtractUShort.java @@ -1,7 +1,7 @@ /* * 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 1.1 (the "License"), the contents of this + * 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 @@ -42,7 +42,7 @@ * compliant with the OpenGL(R) version 1.2.1 Specification. */ -package com.sun.opengl.impl.glu.mipmap; +package com.jogamp.opengl.impl.glu.mipmap; import java.nio.*; diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/HalveImage.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/HalveImage.java index 7f2e87a63..893d33c66 100644 --- a/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/HalveImage.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/HalveImage.java @@ -1,7 +1,7 @@ /* * 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 1.1 (the "License"), the contents of this + * 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 @@ -42,7 +42,7 @@ * compliant with the OpenGL(R) version 1.2.1 Specification. */ -package com.sun.opengl.impl.glu.mipmap; +package com.jogamp.opengl.impl.glu.mipmap; import javax.media.opengl.GL; import java.nio.*; diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Image.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/Image.java index 605d5547b..b2aaad2f7 100644 --- a/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Image.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/Image.java @@ -1,7 +1,7 @@ /* * 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 1.1 (the "License"), the contents of this + * 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 @@ -42,7 +42,7 @@ * compliant with the OpenGL(R) version 1.2.1 Specification. */ -package com.sun.opengl.impl.glu.mipmap; +package com.jogamp.opengl.impl.glu.mipmap; import javax.media.opengl.GL; import javax.media.opengl.GL2; diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Mipmap.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/Mipmap.java index aa33550ca..1c0707c57 100644 --- a/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Mipmap.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/Mipmap.java @@ -1,7 +1,7 @@ /* * 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 1.1 (the "License"), the contents of this + * 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 @@ -42,14 +42,15 @@ * compliant with the OpenGL(R) version 1.2.1 Specification. */ -package com.sun.opengl.impl.glu.mipmap; +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.sun.opengl.impl.InternalBufferUtil; +import com.jogamp.opengl.impl.InternalBufferUtil; /** * @@ -125,7 +126,7 @@ public class Mipmap { if( !legalFormat( format ) || !legalType( type ) ) { return( GLU.GLU_INVALID_ENUM ); } - if( format == GL2.GL_STENCIL_INDEX ) { + if( format == GL2GL3.GL_STENCIL_INDEX ) { return( GLU.GLU_INVALID_ENUM ); } if( !isLegalFormatForPackedPixelType( format, type ) ) { @@ -137,18 +138,18 @@ public class Mipmap { public static boolean legalFormat( int format ) { 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_RGB ): - case( GL2.GL_RGBA ): - case( GL2.GL_LUMINANCE ): - case( GL2.GL_LUMINANCE_ALPHA ): - case( GL2.GL_BGR ): - case( GL2.GL_BGRA ): + 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 ); @@ -158,25 +159,25 @@ public class Mipmap { public static boolean legalType( int type ) { switch( type ) { case( GL2.GL_BITMAP ): - case( GL2.GL_BYTE ): - case( GL2.GL_UNSIGNED_BYTE ): - case( GL2.GL_SHORT ): - case( GL2.GL_UNSIGNED_SHORT ): - case( GL2.GL_INT ): - case( GL2.GL_UNSIGNED_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 ): + 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 ); @@ -186,18 +187,18 @@ public class Mipmap { public static boolean isTypePackedPixel( int type ) { assert( legalType( type ) ); - if( type == GL2.GL_UNSIGNED_BYTE_3_3_2 || - type == GL2.GL_UNSIGNED_BYTE_2_3_3_REV || - type == GL2.GL_UNSIGNED_SHORT_5_6_5 || - type == GL2.GL_UNSIGNED_SHORT_5_6_5_REV || - type == GL2.GL_UNSIGNED_SHORT_4_4_4_4 || - type == GL2.GL_UNSIGNED_SHORT_4_4_4_4_REV || - type == GL2.GL_UNSIGNED_SHORT_5_5_5_1 || - type == GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV || - type == GL2.GL_UNSIGNED_INT_8_8_8_8 || - type == GL2.GL_UNSIGNED_INT_8_8_8_8_REV || - type == GL2.GL_UNSIGNED_INT_10_10_10_2 || - type == GL2.GL_UNSIGNED_INT_2_10_10_10_REV ) { + 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 ); @@ -210,23 +211,23 @@ public class Mipmap { } // 3_3_2/2_3_3_REV & 5_6_5/5_6_5_REV are only compatible with RGB - if( (type == GL2.GL_UNSIGNED_BYTE_3_3_2 || type == GL2.GL_UNSIGNED_BYTE_2_3_3_REV || - type == GL2.GL_UNSIGNED_SHORT_5_6_5 || type == GL2.GL_UNSIGNED_SHORT_5_6_5_REV ) - & format != GL2.GL_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 == GL2.GL_UNSIGNED_SHORT_4_4_4_4 || - type == GL2.GL_UNSIGNED_SHORT_4_4_4_4_REV || - type == GL2.GL_UNSIGNED_SHORT_5_5_5_1 || - type == GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV || - type == GL2.GL_UNSIGNED_INT_8_8_8_8 || - type == GL2.GL_UNSIGNED_INT_8_8_8_8_REV || - type == GL2.GL_UNSIGNED_INT_10_10_10_2 || - type == GL2.GL_UNSIGNED_INT_2_10_10_10_REV ) && - (format != GL2.GL_RGBA && format != GL2.GL_BGRA) ) { + 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 ); @@ -272,27 +273,27 @@ public class Mipmap { assert( heightAtLevelOne > 0 ); // does width x height at level 1 & all their mipmaps fit? - if( target == GL2.GL_TEXTURE_2D || target == GL2.GL_PROXY_TEXTURE_2D ) { - proxyTarget = GL2.GL_PROXY_TEXTURE_2D; + 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 == GL2.GL_TEXTURE_CUBE_MAP_POSITIVE_X) || - (target == GL2.GL_TEXTURE_CUBE_MAP_NEGATIVE_X) || - (target == GL2.GL_TEXTURE_CUBE_MAP_POSITIVE_Y) || - (target == GL2.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y) || - (target == GL2.GL_TEXTURE_CUBE_MAP_POSITIVE_Z) || - (target == GL2.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z) ) { - proxyTarget = GL2.GL_PROXY_TEXTURE_CUBE_MAP; + } 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 == GL2.GL_TEXTURE_1D || target == GL2.GL_PROXY_TEXTURE_1D ); - proxyTarget = GL2.GL_PROXY_TEXTURE_1D; - gl.getGL2().glTexImage1D( proxyTarget, 1, internalFormat, widthAtLevelOne, + 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.isGL2()) { - gl.getGL2().glGetTexLevelParameteriv( proxyTarget, 1, GL2.GL_TEXTURE_WIDTH, proxyWidth, 0 ); + if(gl.isGL2GL3()) { + gl.getGL2GL3().glGetTexLevelParameteriv( proxyTarget, 1, GL2GL3.GL_TEXTURE_WIDTH, proxyWidth, 0 ); } else { proxyWidth[0] = 0; } @@ -324,7 +325,7 @@ public class Mipmap { } } int[] maxsize = new int[1]; - gl.glGetIntegerv( GL2.GL_MAX_TEXTURE_SIZE, maxsize , 0); + 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] ) { @@ -355,13 +356,13 @@ public class Mipmap { assert( depthAtLevelOne > 0 ); // does width x height x depth at level 1 & all their mipmaps fit? - if( target == GL2.GL_TEXTURE_3D || target == GL2.GL_PROXY_TEXTURE_3D ) { - proxyTarget = GL2.GL_PROXY_TEXTURE_3D; - gl.getGL2().glTexImage3D( proxyTarget, 1, internalFormat, widthAtLevelOne, + 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.isGL2()) { - gl.getGL2().glGetTexLevelParameteriv( proxyTarget, 1, GL2.GL_TEXTURE_WIDTH, proxyWidth, 0 ); + if(gl.isGL2GL3()) { + gl.getGL2GL3().glGetTexLevelParameteriv( proxyTarget, 1, GL2GL3.GL_TEXTURE_WIDTH, proxyWidth, 0 ); } else { proxyWidth[0] = 0; } @@ -388,30 +389,30 @@ public class Mipmap { // Return the number of elements per grtoup of a specified gromat // If the type is packedpixels then answer is 1 - if( type == GL2.GL_UNSIGNED_BYTE_3_3_2 || - type == GL2.GL_UNSIGNED_BYTE_2_3_3_REV || - type == GL2.GL_UNSIGNED_SHORT_5_6_5 || - type == GL2.GL_UNSIGNED_SHORT_5_6_5_REV || - type == GL2.GL_UNSIGNED_SHORT_4_4_4_4 || - type == GL2.GL_UNSIGNED_SHORT_4_4_4_4_REV || - type == GL2.GL_UNSIGNED_SHORT_5_5_5_1 || - type == GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV || - type == GL2.GL_UNSIGNED_INT_8_8_8_8 || - type == GL2.GL_UNSIGNED_INT_8_8_8_8_REV || - type == GL2.GL_UNSIGNED_INT_10_10_10_2 || - type == GL2.GL_UNSIGNED_INT_2_10_10_10_REV ) { + 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( GL2.GL_RGB ): - case( GL2.GL_BGR ): + case( GL2GL3.GL_RGB ): + case( GL2GL3.GL_BGR ): return( 3 ); - case( GL2.GL_LUMINANCE_ALPHA ): + case( GL2GL3.GL_LUMINANCE_ALPHA ): return( 2 ); - case( GL2.GL_RGBA ): - case( GL2.GL_BGRA ): + case( GL2GL3.GL_RGBA ): + case( GL2GL3.GL_BGRA ): return( 4 ); default: return( 1 ); @@ -423,27 +424,27 @@ public class Mipmap { switch( type ) { case( GL2.GL_BITMAP ): - case( GL2.GL_BYTE ): - case( GL2.GL_UNSIGNED_BYTE ): - case( GL2.GL_UNSIGNED_BYTE_3_3_2 ): - case( GL2.GL_UNSIGNED_BYTE_2_3_3_REV ): + 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( GL2.GL_SHORT ): - case( GL2.GL_UNSIGNED_SHORT ): - 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( 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( GL2.GL_INT ): - case( GL2.GL_UNSIGNED_INT ): - 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 ): - case( GL2.GL_FLOAT ): + 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 ); @@ -451,7 +452,7 @@ public class Mipmap { } public static boolean is_index( int format ) { - return( format == GL2.GL_COLOR_INDEX || format == GL2.GL_STENCIL_INDEX ); + 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. */ @@ -483,67 +484,67 @@ public class Mipmap { public static void retrieveStoreModes( GL gl, PixelStorageModes psm ) { int[] a = new int[1]; - gl.glGetIntegerv( GL2.GL_UNPACK_ALIGNMENT, a, 0); + gl.glGetIntegerv( GL2GL3.GL_UNPACK_ALIGNMENT, a, 0); psm.setUnpackAlignment( a[0] ); - gl.glGetIntegerv( GL2.GL_UNPACK_ROW_LENGTH, a, 0); + gl.glGetIntegerv( GL2GL3.GL_UNPACK_ROW_LENGTH, a, 0); psm.setUnpackRowLength( a[0] ); - gl.glGetIntegerv( GL2.GL_UNPACK_SKIP_ROWS, a, 0); + gl.glGetIntegerv( GL2GL3.GL_UNPACK_SKIP_ROWS, a, 0); psm.setUnpackSkipRows( a[0] ); - gl.glGetIntegerv( GL2.GL_UNPACK_SKIP_PIXELS, a, 0); + gl.glGetIntegerv( GL2GL3.GL_UNPACK_SKIP_PIXELS, a, 0); psm.setUnpackSkipPixels( a[0] ); - gl.glGetIntegerv( GL2.GL_UNPACK_LSB_FIRST, a, 0); + gl.glGetIntegerv( GL2GL3.GL_UNPACK_LSB_FIRST, a, 0); psm.setUnpackLsbFirst( ( a[0] == 1 ) ); - gl.glGetIntegerv( GL2.GL_UNPACK_SWAP_BYTES, a, 0); + gl.glGetIntegerv( GL2GL3.GL_UNPACK_SWAP_BYTES, a, 0); psm.setUnpackSwapBytes( ( a[0] == 1 ) ); - gl.glGetIntegerv( GL2.GL_PACK_ALIGNMENT, a, 0); + gl.glGetIntegerv( GL2GL3.GL_PACK_ALIGNMENT, a, 0); psm.setPackAlignment( a[0] ); - gl.glGetIntegerv( GL2.GL_PACK_ROW_LENGTH, a, 0); + gl.glGetIntegerv( GL2GL3.GL_PACK_ROW_LENGTH, a, 0); psm.setPackRowLength( a[0] ); - gl.glGetIntegerv( GL2.GL_PACK_SKIP_ROWS, a, 0); + gl.glGetIntegerv( GL2GL3.GL_PACK_SKIP_ROWS, a, 0); psm.setPackSkipRows( a[0] ); - gl.glGetIntegerv( GL2.GL_PACK_SKIP_PIXELS, a, 0); + gl.glGetIntegerv( GL2GL3.GL_PACK_SKIP_PIXELS, a, 0); psm.setPackSkipPixels( a[0] ); - gl.glGetIntegerv( GL2.GL_PACK_LSB_FIRST, a, 0); + gl.glGetIntegerv( GL2GL3.GL_PACK_LSB_FIRST, a, 0); psm.setPackLsbFirst( ( a[0] == 1 ) ); - gl.glGetIntegerv( GL2.GL_PACK_SWAP_BYTES, a, 0); + 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( GL2.GL_UNPACK_ALIGNMENT, a, 0); + gl.glGetIntegerv( GL2GL3.GL_UNPACK_ALIGNMENT, a, 0); psm.setUnpackAlignment( a[0] ); - gl.glGetIntegerv( GL2.GL_UNPACK_ROW_LENGTH, a, 0); + gl.glGetIntegerv( GL2GL3.GL_UNPACK_ROW_LENGTH, a, 0); psm.setUnpackRowLength( a[0] ); - gl.glGetIntegerv( GL2.GL_UNPACK_SKIP_ROWS, a, 0); + gl.glGetIntegerv( GL2GL3.GL_UNPACK_SKIP_ROWS, a, 0); psm.setUnpackSkipRows( a[0] ); - gl.glGetIntegerv( GL2.GL_UNPACK_SKIP_PIXELS, a, 0); + gl.glGetIntegerv( GL2GL3.GL_UNPACK_SKIP_PIXELS, a, 0); psm.setUnpackSkipPixels( a[0] ); - gl.glGetIntegerv( GL2.GL_UNPACK_LSB_FIRST, a, 0); + gl.glGetIntegerv( GL2GL3.GL_UNPACK_LSB_FIRST, a, 0); psm.setUnpackLsbFirst( ( a[0] == 1 ) ); - gl.glGetIntegerv( GL2.GL_UNPACK_SWAP_BYTES, a, 0); + gl.glGetIntegerv( GL2GL3.GL_UNPACK_SWAP_BYTES, a, 0); psm.setUnpackSwapBytes( ( a[0] == 1 ) ); - gl.glGetIntegerv( GL2.GL_UNPACK_SKIP_IMAGES, a, 0); + gl.glGetIntegerv( GL2GL3.GL_UNPACK_SKIP_IMAGES, a, 0); psm.setUnpackSkipImages( a[0] ); - gl.glGetIntegerv( GL2.GL_UNPACK_IMAGE_HEIGHT, a, 0); + gl.glGetIntegerv( GL2GL3.GL_UNPACK_IMAGE_HEIGHT, a, 0); psm.setUnpackImageHeight( a[0] ); - gl.glGetIntegerv( GL2.GL_PACK_ALIGNMENT, a, 0); + gl.glGetIntegerv( GL2GL3.GL_PACK_ALIGNMENT, a, 0); psm.setPackAlignment( a[0] ); - gl.glGetIntegerv( GL2.GL_PACK_ROW_LENGTH, a, 0); + gl.glGetIntegerv( GL2GL3.GL_PACK_ROW_LENGTH, a, 0); psm.setPackRowLength( a[0] ); - gl.glGetIntegerv( GL2.GL_PACK_SKIP_ROWS, a, 0); + gl.glGetIntegerv( GL2GL3.GL_PACK_SKIP_ROWS, a, 0); psm.setPackSkipRows( a[0] ); - gl.glGetIntegerv( GL2.GL_PACK_SKIP_PIXELS, a, 0 ); + gl.glGetIntegerv( GL2GL3.GL_PACK_SKIP_PIXELS, a, 0 ); psm.setPackSkipPixels( a[0] ); - gl.glGetIntegerv( GL2.GL_PACK_LSB_FIRST, a, 0 ); + gl.glGetIntegerv( GL2GL3.GL_PACK_LSB_FIRST, a, 0 ); psm.setPackLsbFirst( ( a[0] == 1 ) ); - gl.glGetIntegerv( GL2.GL_PACK_SWAP_BYTES, a, 0 ); + gl.glGetIntegerv( GL2GL3.GL_PACK_SWAP_BYTES, a, 0 ); psm.setPackSwapBytes( ( a[0] == 1 ) ); - gl.glGetIntegerv( GL2.GL_PACK_SKIP_IMAGES, a, 0 ); + gl.glGetIntegerv( GL2GL3.GL_PACK_SKIP_IMAGES, a, 0 ); psm.setPackSkipImages( a[0] ); - gl.glGetIntegerv( GL2.GL_PACK_IMAGE_HEIGHT, a, 0 ); + gl.glGetIntegerv( GL2GL3.GL_PACK_IMAGE_HEIGHT, a, 0 ); psm.setPackImageHeight( a[0] ); } @@ -574,8 +575,8 @@ public class Mipmap { if( !isLegalFormatForPackedPixelType( format, typeout ) ) { return( GLU.GLU_INVALID_OPERATION ); } - beforeimage = InternalBufferUtil.nativeOrder(ByteBuffer.allocateDirect( image_size( widthin, heightin, format, GL2.GL_UNSIGNED_SHORT ) )); - afterimage = InternalBufferUtil.nativeOrder(ByteBuffer.allocateDirect( image_size( widthout, heightout, format, GL2.GL_UNSIGNED_SHORT ) )); + beforeimage = InternalBufferUtil.nativeOrder(ByteBuffer.allocateDirect( image_size( widthin, heightin, format, GL2GL3.GL_UNSIGNED_SHORT ) )); + afterimage = InternalBufferUtil.nativeOrder(ByteBuffer.allocateDirect( image_size( widthout, heightout, format, GL2GL3.GL_UNSIGNED_SHORT ) )); if( beforeimage == null || afterimage == null ) { return( GLU.GLU_OUT_OF_MEMORY ); } diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/PixelStorageModes.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/PixelStorageModes.java index 82324f1b0..43b5c5691 100644 --- a/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/PixelStorageModes.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/PixelStorageModes.java @@ -1,7 +1,7 @@ /* * 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 1.1 (the "License"), the contents of this + * 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 @@ -42,7 +42,7 @@ * compliant with the OpenGL(R) version 1.2.1 Specification. */ -package com.sun.opengl.impl.glu.mipmap; +package com.jogamp.opengl.impl.glu.mipmap; /** * diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/ScaleInternal.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/ScaleInternal.java index f51c72ea6..f0bb7fb33 100644 --- a/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/ScaleInternal.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/ScaleInternal.java @@ -1,7 +1,7 @@ /* * 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 1.1 (the "License"), the contents of this + * 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 @@ -42,13 +42,13 @@ * compliant with the OpenGL(R) version 1.2.1 Specification. */ -package com.sun.opengl.impl.glu.mipmap; +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.sun.opengl.impl.InternalBufferUtil; +import com.jogamp.opengl.impl.InternalBufferUtil; /** * diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Type_Widget.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/Type_Widget.java index d5c6768b3..b329840ef 100644 --- a/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Type_Widget.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/Type_Widget.java @@ -1,7 +1,7 @@ /* * 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 1.1 (the "License"), the contents of this + * 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 @@ -42,7 +42,7 @@ * compliant with the OpenGL(R) version 1.2.1 Specification. */ -package com.sun.opengl.impl.glu.mipmap; +package com.jogamp.opengl.impl.glu.mipmap; import java.nio.*; diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Arc.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Arc.java index e96aa83f8..9ee2494a1 100755 --- a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Arc.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Arc.java @@ -1,9 +1,9 @@ -package com.sun.opengl.impl.glu.nurbs; +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 1.1 (the "License"), the contents of this +** 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 diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/ArcSdirSorter.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/ArcSdirSorter.java index f8fbe2930..3955e3176 100755 --- a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/ArcSdirSorter.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/ArcSdirSorter.java @@ -1,9 +1,9 @@ -package com.sun.opengl.impl.glu.nurbs; +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 1.1 (the "License"), the contents of this + ** 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 diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/ArcTdirSorter.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/ArcTdirSorter.java index 9e9a10b42..098ba97b7 100755 --- a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/ArcTdirSorter.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/ArcTdirSorter.java @@ -1,9 +1,9 @@ -package com.sun.opengl.impl.glu.nurbs; +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 1.1 (the "License"), the contents of this + ** 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 diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/ArcTesselator.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/ArcTesselator.java index 496e8b7d6..edfb8905f 100755 --- a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/ArcTesselator.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/ArcTesselator.java @@ -1,9 +1,9 @@ -package com.sun.opengl.impl.glu.nurbs; +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 1.1 (the "License"), the contents of this + ** 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 diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Backend.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Backend.java index 9467104f5..39097720c 100755 --- a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Backend.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Backend.java @@ -1,9 +1,9 @@ -package com.sun.opengl.impl.glu.nurbs; +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 1.1 (the "License"), the contents of this + ** 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 diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/BezierArc.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/BezierArc.java index ef4cf0684..d9b390b67 100755 --- a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/BezierArc.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/BezierArc.java @@ -1,9 +1,9 @@ -package com.sun.opengl.impl.glu.nurbs; +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 1.1 (the "License"), the contents of this + ** 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 diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Bin.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Bin.java index 0f0806d96..61316f348 100755 --- a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Bin.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Bin.java @@ -1,9 +1,9 @@ -package com.sun.opengl.impl.glu.nurbs; +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 1.1 (the "License"), the contents of this + ** 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 diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Breakpt.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Breakpt.java index 9cccc5102..b5b88ad96 100755 --- a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Breakpt.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Breakpt.java @@ -1,9 +1,9 @@ -package com.sun.opengl.impl.glu.nurbs; +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 1.1 (the "License"), the contents of this + ** 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 diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/CArrayOfArcs.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/CArrayOfArcs.java index 3d6e1d47f..0646e1d9f 100755 --- a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/CArrayOfArcs.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/CArrayOfArcs.java @@ -1,4 +1,4 @@ -package com.sun.opengl.impl.glu.nurbs; +package com.jogamp.opengl.impl.glu.nurbs; /** * Class replacing C language pointer diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/CArrayOfBreakpts.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/CArrayOfBreakpts.java index f5932d954..e47fdf966 100755 --- a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/CArrayOfBreakpts.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/CArrayOfBreakpts.java @@ -1,4 +1,4 @@ -package com.sun.opengl.impl.glu.nurbs; +package com.jogamp.opengl.impl.glu.nurbs; /** * Class replacing C language pointer diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/CArrayOfFloats.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/CArrayOfFloats.java index fb3fac69b..60cef9919 100755 --- a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/CArrayOfFloats.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/CArrayOfFloats.java @@ -1,4 +1,4 @@ -package com.sun.opengl.impl.glu.nurbs; +package com.jogamp.opengl.impl.glu.nurbs; /** * Class replacing C language pointer diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/CArrayOfQuiltspecs.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/CArrayOfQuiltspecs.java index fed301895..ef16a8204 100755 --- a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/CArrayOfQuiltspecs.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/CArrayOfQuiltspecs.java @@ -1,4 +1,4 @@ -package com.sun.opengl.impl.glu.nurbs; +package com.jogamp.opengl.impl.glu.nurbs; /** * Class replacing C language pointer diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Curve.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Curve.java index 318c8416c..fb1a5acea 100755 --- a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Curve.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Curve.java @@ -1,9 +1,9 @@ -package com.sun.opengl.impl.glu.nurbs; +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 1.1 (the "License"), the contents of this + ** 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 diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/CurveEvaluator.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/CurveEvaluator.java index a6393ddf4..c27ffd4c4 100755 --- a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/CurveEvaluator.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/CurveEvaluator.java @@ -1,9 +1,9 @@ -package com.sun.opengl.impl.glu.nurbs; +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 1.1 (the "License"), the contents of this + ** 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 diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Curvelist.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Curvelist.java index fdce39b46..fc3018833 100755 --- a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Curvelist.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Curvelist.java @@ -1,9 +1,9 @@ -package com.sun.opengl.impl.glu.nurbs; +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 1.1 (the "License"), the contents of this + ** 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 diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/DisplayList.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/DisplayList.java index 735c36edf..39a3a28f4 100755 --- a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/DisplayList.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/DisplayList.java @@ -1,9 +1,9 @@ -package com.sun.opengl.impl.glu.nurbs; +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 1.1 (the "License"), the contents of this + ** 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 diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Flist.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Flist.java index d9e798854..00757ed7e 100755 --- a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Flist.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Flist.java @@ -1,9 +1,9 @@ -package com.sun.opengl.impl.glu.nurbs; +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 1.1 (the "License"), the contents of this + ** 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 diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Knotspec.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Knotspec.java index bcb55388d..9251aa231 100755 --- a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Knotspec.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Knotspec.java @@ -1,9 +1,9 @@ -package com.sun.opengl.impl.glu.nurbs; +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 1.1 (the "License"), the contents of this + ** 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 diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Knotvector.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Knotvector.java index c7c3d4578..658a1cbda 100755 --- a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Knotvector.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Knotvector.java @@ -1,9 +1,9 @@ -package com.sun.opengl.impl.glu.nurbs; +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 1.1 (the "License"), the contents of this + ** 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 diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Mapdesc.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Mapdesc.java index 8b52a4a8a..568eddc51 100755 --- a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Mapdesc.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Mapdesc.java @@ -1,9 +1,9 @@ -package com.sun.opengl.impl.glu.nurbs; +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 1.1 (the "License"), the contents of this + ** 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 diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Maplist.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Maplist.java index 3b6e22ea5..b23a1f665 100755 --- a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Maplist.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Maplist.java @@ -1,9 +1,9 @@ -package com.sun.opengl.impl.glu.nurbs; +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 1.1 (the "License"), the contents of this + ** 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 diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/NurbsConsts.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/NurbsConsts.java index c98e74b7c..ee7f3b31b 100755 --- a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/NurbsConsts.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/NurbsConsts.java @@ -1,9 +1,9 @@ -package com.sun.opengl.impl.glu.nurbs; +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 1.1 (the "License"), the contents of this + ** 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 diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/O_curve.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/O_curve.java index b130226c4..900f8e56f 100755 --- a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/O_curve.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/O_curve.java @@ -1,9 +1,9 @@ -package com.sun.opengl.impl.glu.nurbs; +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 1.1 (the "License"), the contents of this + ** 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 diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/O_nurbscurve.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/O_nurbscurve.java index 68bf60b27..81110813f 100755 --- a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/O_nurbscurve.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/O_nurbscurve.java @@ -1,9 +1,9 @@ -package com.sun.opengl.impl.glu.nurbs; +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 1.1 (the "License"), the contents of this + ** 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 diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/O_nurbssurface.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/O_nurbssurface.java index 1cbaa6ccc..b598f525d 100755 --- a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/O_nurbssurface.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/O_nurbssurface.java @@ -1,9 +1,9 @@ -package com.sun.opengl.impl.glu.nurbs; +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 1.1 (the "License"), the contents of this + ** 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 diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/O_pwlcurve.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/O_pwlcurve.java index 4dec066d6..e50f41d81 100755 --- a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/O_pwlcurve.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/O_pwlcurve.java @@ -1,9 +1,9 @@ -package com.sun.opengl.impl.glu.nurbs; +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 1.1 (the "License"), the contents of this + ** 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 diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/O_surface.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/O_surface.java index 4ef680c2f..76ac79f0a 100755 --- a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/O_surface.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/O_surface.java @@ -1,9 +1,9 @@ -package com.sun.opengl.impl.glu.nurbs; +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 1.1 (the "License"), the contents of this + ** 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 diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/O_trim.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/O_trim.java index c1f61ebab..17e5002df 100755 --- a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/O_trim.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/O_trim.java @@ -1,9 +1,9 @@ -package com.sun.opengl.impl.glu.nurbs; +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 1.1 (the "License"), the contents of this + ** 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 diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Patch.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Patch.java index f15ad1f92..d3066cc84 100755 --- a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Patch.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Patch.java @@ -1,9 +1,9 @@ -package com.sun.opengl.impl.glu.nurbs; +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 1.1 (the "License"), the contents of this + ** 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 diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Patchlist.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Patchlist.java index b2b9033ec..8b439a02f 100755 --- a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Patchlist.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Patchlist.java @@ -1,9 +1,9 @@ -package com.sun.opengl.impl.glu.nurbs; +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 1.1 (the "License"), the contents of this + ** 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 diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Property.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Property.java index e0ad1dd32..b486a0ead 100755 --- a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Property.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Property.java @@ -1,9 +1,9 @@ -package com.sun.opengl.impl.glu.nurbs; +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 1.1 (the "License"), the contents of this + ** 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 diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Pspec.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Pspec.java index 5fc66fa82..1e60ed335 100755 --- a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Pspec.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Pspec.java @@ -1,9 +1,9 @@ -package com.sun.opengl.impl.glu.nurbs; +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 1.1 (the "License"), the contents of this + ** 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 diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/PwlArc.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/PwlArc.java index 6b8255d85..0c9eca91e 100755 --- a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/PwlArc.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/PwlArc.java @@ -1,9 +1,9 @@ -package com.sun.opengl.impl.glu.nurbs; +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 1.1 (the "License"), the contents of this + ** 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 diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Quilt.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Quilt.java index bc058b093..03e809d23 100755 --- a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Quilt.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Quilt.java @@ -1,9 +1,9 @@ -package com.sun.opengl.impl.glu.nurbs; +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 1.1 (the "License"), the contents of this + ** 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 diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Quiltspec.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Quiltspec.java index d94986a03..6c8e55e06 100755 --- a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Quiltspec.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Quiltspec.java @@ -1,9 +1,9 @@ -package com.sun.opengl.impl.glu.nurbs; +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 1.1 (the "License"), the contents of this + ** 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 diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/README.txt b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/README.txt index 89630c71e..89630c71e 100755 --- a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/README.txt +++ b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/README.txt diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Renderhints.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Renderhints.java index c571d9d88..d1a23fbab 100755 --- a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Renderhints.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Renderhints.java @@ -1,9 +1,9 @@ -package com.sun.opengl.impl.glu.nurbs; +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 1.1 (the "License"), the contents of this + ** 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 diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Splinespec.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Splinespec.java index 35288c67d..487b47f2d 100755 --- a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Splinespec.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Splinespec.java @@ -1,9 +1,9 @@ -package com.sun.opengl.impl.glu.nurbs; +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 1.1 (the "License"), the contents of this + ** 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 diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Subdivider.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Subdivider.java index b1506d6a1..99c1b740b 100755 --- a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Subdivider.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/Subdivider.java @@ -1,9 +1,9 @@ -package com.sun.opengl.impl.glu.nurbs; +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 1.1 (the "License"), the contents of this + ** 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 diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/SurfaceEvaluator.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/SurfaceEvaluator.java index feb3bc9a7..fe23f9c08 100755 --- a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/SurfaceEvaluator.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/SurfaceEvaluator.java @@ -1,9 +1,9 @@ -package com.sun.opengl.impl.glu.nurbs; +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 1.1 (the "License"), the contents of this + ** 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 diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/TrimVertex.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/TrimVertex.java index ec3f6fc10..6608f8f40 100755 --- a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/TrimVertex.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/glu/nurbs/TrimVertex.java @@ -1,9 +1,9 @@ -package com.sun.opengl.impl.glu.nurbs; +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 1.1 (the "License"), the contents of this + ** 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 diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/registry/Registry.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/registry/Registry.java index 488a3c0f2..21b15f4d4 100644 --- a/src/jogl/classes/com/sun/opengl/impl/glu/registry/Registry.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/glu/registry/Registry.java @@ -1,7 +1,7 @@ /* * 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 1.1 (the "License"), the contents of this + * 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 @@ -42,7 +42,7 @@ * compliant with the OpenGL(R) version 1.2.1 Specification. */ -package com.sun.opengl.impl.glu.registry; +package com.jogamp.opengl.impl.glu.registry; import javax.media.opengl.glu.GLU; diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/tessellator/ActiveRegion.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/ActiveRegion.java index a04c5c74b..85397dd6a 100644 --- a/src/jogl/classes/com/sun/opengl/impl/glu/tessellator/ActiveRegion.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/ActiveRegion.java @@ -6,7 +6,7 @@ /* ** 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 1.1 (the "License"), the contents of this +** 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 @@ -50,7 +50,7 @@ ** Java Port: Pepijn Van Eeckhoudt, July 2003 ** Java Port: Nathan Parker Burg, August 2003 */ -package com.sun.opengl.impl.glu.tessellator; +package com.jogamp.opengl.impl.glu.tessellator; class ActiveRegion { diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/tessellator/CachedVertex.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/CachedVertex.java index 993671c0d..8948acfec 100644 --- a/src/jogl/classes/com/sun/opengl/impl/glu/tessellator/CachedVertex.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/CachedVertex.java @@ -6,7 +6,7 @@ /* ** 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 1.1 (the "License"), the contents of this +** 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 @@ -50,7 +50,7 @@ ** Java Port: Pepijn Van Eeckhoudt, July 2003 ** Java Port: Nathan Parker Burg, August 2003 */ -package com.sun.opengl.impl.glu.tessellator; +package com.jogamp.opengl.impl.glu.tessellator; class CachedVertex { public double[] coords = new double[3]; diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/tessellator/Dict.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/Dict.java index d2f6e3790..d26948e7f 100644 --- a/src/jogl/classes/com/sun/opengl/impl/glu/tessellator/Dict.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/Dict.java @@ -6,7 +6,7 @@ /* ** 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 1.1 (the "License"), the contents of this +** 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 @@ -50,7 +50,7 @@ ** Java Port: Pepijn Van Eeckhoudt, July 2003 ** Java Port: Nathan Parker Burg, August 2003 */ -package com.sun.opengl.impl.glu.tessellator; +package com.jogamp.opengl.impl.glu.tessellator; class Dict { DictNode head; diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/tessellator/DictNode.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/DictNode.java index 1222bd948..8864de127 100644 --- a/src/jogl/classes/com/sun/opengl/impl/glu/tessellator/DictNode.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/DictNode.java @@ -6,7 +6,7 @@ /* ** 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 1.1 (the "License"), the contents of this +** 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 @@ -50,7 +50,7 @@ ** Java Port: Pepijn Van Eeckhoudt, July 2003 ** Java Port: Nathan Parker Burg, August 2003 */ -package com.sun.opengl.impl.glu.tessellator; +package com.jogamp.opengl.impl.glu.tessellator; class DictNode { Object key; diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/tessellator/GLUface.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/GLUface.java index f0589dbea..2ff4aae59 100644 --- a/src/jogl/classes/com/sun/opengl/impl/glu/tessellator/GLUface.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/GLUface.java @@ -6,7 +6,7 @@ /* ** 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 1.1 (the "License"), the contents of this +** 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 @@ -50,7 +50,7 @@ ** Java Port: Pepijn Van Eeckhoudt, July 2003 ** Java Port: Nathan Parker Burg, August 2003 */ -package com.sun.opengl.impl.glu.tessellator; +package com.jogamp.opengl.impl.glu.tessellator; class GLUface { public GLUface next; /* next face (never NULL) */ diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/tessellator/GLUhalfEdge.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/GLUhalfEdge.java index 1b6e81cc5..c2128b616 100644 --- a/src/jogl/classes/com/sun/opengl/impl/glu/tessellator/GLUhalfEdge.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/GLUhalfEdge.java @@ -6,7 +6,7 @@ /* ** 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 1.1 (the "License"), the contents of this +** 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 @@ -50,7 +50,7 @@ ** Java Port: Pepijn Van Eeckhoudt, July 2003 ** Java Port: Nathan Parker Burg, August 2003 */ -package com.sun.opengl.impl.glu.tessellator; +package com.jogamp.opengl.impl.glu.tessellator; class GLUhalfEdge { public GLUhalfEdge next; /* doubly-linked list (prev==Sym->next) */ @@ -58,10 +58,10 @@ class GLUhalfEdge { 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.sun.opengl.impl.glu.tessellator.GLUface Lface; /* left face */ + public com.jogamp.opengl.impl.glu.tessellator.GLUface Lface; /* left face */ /* Internal data (keep hidden) */ - public com.sun.opengl.impl.glu.tessellator.ActiveRegion activeRegion; /* a region with this upper edge (sweep.c) */ + 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; diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/tessellator/GLUmesh.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/GLUmesh.java index 73fbe815e..493eb20f4 100644 --- a/src/jogl/classes/com/sun/opengl/impl/glu/tessellator/GLUmesh.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/GLUmesh.java @@ -6,7 +6,7 @@ /* ** 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 1.1 (the "License"), the contents of this +** 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 @@ -50,11 +50,11 @@ ** Java Port: Pepijn Van Eeckhoudt, July 2003 ** Java Port: Nathan Parker Burg, August 2003 */ -package com.sun.opengl.impl.glu.tessellator; +package com.jogamp.opengl.impl.glu.tessellator; class GLUmesh { GLUvertex vHead = new GLUvertex(); /* dummy header for vertex list */ - com.sun.opengl.impl.glu.tessellator.GLUface fHead = new GLUface(); /* dummy header for face list */ - com.sun.opengl.impl.glu.tessellator.GLUhalfEdge eHead = new GLUhalfEdge(true); /* dummy header for edge list */ - com.sun.opengl.impl.glu.tessellator.GLUhalfEdge eHeadSym = new GLUhalfEdge(false); /* and its symmetric counterpart */ + 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/sun/opengl/impl/glu/tessellator/GLUtessellatorImpl.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/GLUtessellatorImpl.java index f4efb116a..b21998355 100644 --- a/src/jogl/classes/com/sun/opengl/impl/glu/tessellator/GLUtessellatorImpl.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/GLUtessellatorImpl.java @@ -6,7 +6,7 @@ /* ** 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 1.1 (the "License"), the contents of this +** 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 @@ -50,9 +50,9 @@ ** Java Port: Pepijn Van Eeckhoudt, July 2003 ** Java Port: Nathan Parker Burg, August 2003 */ -package com.sun.opengl.impl.glu.tessellator; +package com.jogamp.opengl.impl.glu.tessellator; -import com.sun.opengl.impl.glu.tessellator.*; +import com.jogamp.opengl.impl.glu.tessellator.*; import javax.media.opengl.*; import javax.media.opengl.glu.*; diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/tessellator/GLUvertex.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/GLUvertex.java index e97767a12..af294caad 100644 --- a/src/jogl/classes/com/sun/opengl/impl/glu/tessellator/GLUvertex.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/GLUvertex.java @@ -6,7 +6,7 @@ /* ** 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 1.1 (the "License"), the contents of this +** 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 @@ -50,12 +50,12 @@ ** Java Port: Pepijn Van Eeckhoudt, July 2003 ** Java Port: Nathan Parker Burg, August 2003 */ -package com.sun.opengl.impl.glu.tessellator; +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.sun.opengl.impl.glu.tessellator.GLUhalfEdge anEdge; /* a half-edge with this origin */ + 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) */ diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/tessellator/Geom.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/Geom.java index 1287a60e0..2710346d1 100644 --- a/src/jogl/classes/com/sun/opengl/impl/glu/tessellator/Geom.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/Geom.java @@ -6,7 +6,7 @@ /* ** 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 1.1 (the "License"), the contents of this +** 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 @@ -50,7 +50,7 @@ ** Java Port: Pepijn Van Eeckhoudt, July 2003 ** Java Port: Nathan Parker Burg, August 2003 */ -package com.sun.opengl.impl.glu.tessellator; +package com.jogamp.opengl.impl.glu.tessellator; class Geom { private Geom() { diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/tessellator/Mesh.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/Mesh.java index 290fb1037..b8be9f80f 100644 --- a/src/jogl/classes/com/sun/opengl/impl/glu/tessellator/Mesh.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/Mesh.java @@ -6,7 +6,7 @@ /* ** 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 1.1 (the "License"), the contents of this +** 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 @@ -50,7 +50,7 @@ ** Java Port: Pepijn Van Eeckhoudt, July 2003 ** Java Port: Nathan Parker Burg, August 2003 */ -package com.sun.opengl.impl.glu.tessellator; +package com.jogamp.opengl.impl.glu.tessellator; class Mesh { private Mesh() { @@ -61,19 +61,19 @@ class Mesh { * No vertex or face structures are allocated, but these must be assigned * before the current edge operation is completed. */ - static com.sun.opengl.impl.glu.tessellator.GLUhalfEdge MakeEdge(com.sun.opengl.impl.glu.tessellator.GLUhalfEdge eNext) { - com.sun.opengl.impl.glu.tessellator.GLUhalfEdge e; - com.sun.opengl.impl.glu.tessellator.GLUhalfEdge eSym; - com.sun.opengl.impl.glu.tessellator.GLUhalfEdge ePrev; + 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.sun.opengl.impl.glu.tessellator.GLUhalfEdge(true); + e = new com.jogamp.opengl.impl.glu.tessellator.GLUhalfEdge(true); // eSym = &pair - > eSym; - eSym = new com.sun.opengl.impl.glu.tessellator.GLUhalfEdge(false); + eSym = new com.jogamp.opengl.impl.glu.tessellator.GLUhalfEdge(false); /* Make sure eNext points to the first edge of the edge pair */ @@ -115,9 +115,9 @@ class Mesh { * depending on whether a and b belong to different face or vertex rings. * For more explanation see __gl_meshSplice() below. */ - static void Splice(com.sun.opengl.impl.glu.tessellator.GLUhalfEdge a, com.sun.opengl.impl.glu.tessellator.GLUhalfEdge b) { - com.sun.opengl.impl.glu.tessellator.GLUhalfEdge aOnext = a.Onext; - com.sun.opengl.impl.glu.tessellator.GLUhalfEdge bOnext = b.Onext; + 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; @@ -131,11 +131,11 @@ class Mesh { * the new vertex *before* vNext so that algorithms which walk the vertex * list will not see the newly created vertices. */ - static void MakeVertex(com.sun.opengl.impl.glu.tessellator.GLUvertex newVertex, - com.sun.opengl.impl.glu.tessellator.GLUhalfEdge eOrig, com.sun.opengl.impl.glu.tessellator.GLUvertex vNext) { - com.sun.opengl.impl.glu.tessellator.GLUhalfEdge e; - com.sun.opengl.impl.glu.tessellator.GLUvertex vPrev; - com.sun.opengl.impl.glu.tessellator.GLUvertex vNew = newVertex; + 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); @@ -164,10 +164,10 @@ class Mesh { * the new face *before* fNext so that algorithms which walk the face * list will not see the newly created faces. */ - static void MakeFace(com.sun.opengl.impl.glu.tessellator.GLUface newFace, com.sun.opengl.impl.glu.tessellator.GLUhalfEdge eOrig, com.sun.opengl.impl.glu.tessellator.GLUface fNext) { - com.sun.opengl.impl.glu.tessellator.GLUhalfEdge e; - com.sun.opengl.impl.glu.tessellator.GLUface fPrev; - com.sun.opengl.impl.glu.tessellator.GLUface fNew = newFace; + 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); @@ -199,8 +199,8 @@ class Mesh { /* KillEdge( eDel ) destroys an edge (the half-edges eDel and eDel->Sym), * and removes from the global edge list. */ - static void KillEdge(com.sun.opengl.impl.glu.tessellator.GLUhalfEdge eDel) { - com.sun.opengl.impl.glu.tessellator.GLUhalfEdge ePrev, eNext; + 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) { @@ -218,9 +218,9 @@ class Mesh { /* 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.sun.opengl.impl.glu.tessellator.GLUvertex vDel, com.sun.opengl.impl.glu.tessellator.GLUvertex newOrg) { - com.sun.opengl.impl.glu.tessellator.GLUhalfEdge e, eStart = vDel.anEdge; - com.sun.opengl.impl.glu.tessellator.GLUvertex vPrev, vNext; + 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; @@ -239,9 +239,9 @@ class Mesh { /* 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.sun.opengl.impl.glu.tessellator.GLUface fDel, com.sun.opengl.impl.glu.tessellator.GLUface newLface) { - com.sun.opengl.impl.glu.tessellator.GLUhalfEdge e, eStart = fDel.anEdge; - com.sun.opengl.impl.glu.tessellator.GLUface fPrev, fNext; + 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; @@ -263,11 +263,11 @@ class Mesh { /* __gl_meshMakeEdge creates one edge, two vertices, and a loop (face). * The loop consists of the two new half-edges. */ - public static com.sun.opengl.impl.glu.tessellator.GLUhalfEdge __gl_meshMakeEdge(com.sun.opengl.impl.glu.tessellator.GLUmesh mesh) { - com.sun.opengl.impl.glu.tessellator.GLUvertex newVertex1 = new com.sun.opengl.impl.glu.tessellator.GLUvertex(); - com.sun.opengl.impl.glu.tessellator.GLUvertex newVertex2 = new com.sun.opengl.impl.glu.tessellator.GLUvertex(); - com.sun.opengl.impl.glu.tessellator.GLUface newFace = new com.sun.opengl.impl.glu.tessellator.GLUface(); - com.sun.opengl.impl.glu.tessellator.GLUhalfEdge e; + 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; @@ -302,7 +302,7 @@ class Mesh { * 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.sun.opengl.impl.glu.tessellator.GLUhalfEdge eOrg, com.sun.opengl.impl.glu.tessellator.GLUhalfEdge eDst) { + 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; @@ -323,7 +323,7 @@ class Mesh { Splice(eDst, eOrg); if (!joiningVertices) { - com.sun.opengl.impl.glu.tessellator.GLUvertex newVertex = new com.sun.opengl.impl.glu.tessellator.GLUvertex(); + 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. @@ -332,7 +332,7 @@ class Mesh { eOrg.Org.anEdge = eOrg; } if (!joiningLoops) { - com.sun.opengl.impl.glu.tessellator.GLUface newFace = new com.sun.opengl.impl.glu.tessellator.GLUface(); + 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. @@ -355,8 +355,8 @@ class Mesh { * plus a few calls to memFree, but this would allocate and delete * unnecessary vertices and faces. */ - static boolean __gl_meshDelete(com.sun.opengl.impl.glu.tessellator.GLUhalfEdge eDel) { - com.sun.opengl.impl.glu.tessellator.GLUhalfEdge eDelSym = eDel.Sym; + 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 @@ -377,7 +377,7 @@ class Mesh { Splice(eDel, eDel.Sym.Lnext); if (!joiningLoops) { - com.sun.opengl.impl.glu.tessellator.GLUface newFace = new com.sun.opengl.impl.glu.tessellator.GLUface(); + 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); @@ -415,9 +415,9 @@ class Mesh { * eNew == eOrg.Lnext, and eNew.Dst is a newly created vertex. * eOrg and eNew will have the same left face. */ - static com.sun.opengl.impl.glu.tessellator.GLUhalfEdge __gl_meshAddEdgeVertex(com.sun.opengl.impl.glu.tessellator.GLUhalfEdge eOrg) { - com.sun.opengl.impl.glu.tessellator.GLUhalfEdge eNewSym; - com.sun.opengl.impl.glu.tessellator.GLUhalfEdge eNew = MakeEdge(eOrg); + 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; @@ -427,7 +427,7 @@ class Mesh { /* Set the vertex and face information */ eNew.Org = eOrg.Sym.Org; { - com.sun.opengl.impl.glu.tessellator.GLUvertex newVertex = new com.sun.opengl.impl.glu.tessellator.GLUvertex(); + com.jogamp.opengl.impl.glu.tessellator.GLUvertex newVertex = new com.jogamp.opengl.impl.glu.tessellator.GLUvertex(); MakeVertex(newVertex, eNewSym, eNew.Org); } @@ -441,9 +441,9 @@ class Mesh { * 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.sun.opengl.impl.glu.tessellator.GLUhalfEdge __gl_meshSplitEdge(com.sun.opengl.impl.glu.tessellator.GLUhalfEdge eOrg) { - com.sun.opengl.impl.glu.tessellator.GLUhalfEdge eNew; - com.sun.opengl.impl.glu.tessellator.GLUhalfEdge tempHalfEdge = __gl_meshAddEdgeVertex(eOrg); + 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; @@ -472,10 +472,10 @@ class Mesh { * 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.sun.opengl.impl.glu.tessellator.GLUhalfEdge __gl_meshConnect(com.sun.opengl.impl.glu.tessellator.GLUhalfEdge eOrg, com.sun.opengl.impl.glu.tessellator.GLUhalfEdge eDst) { - com.sun.opengl.impl.glu.tessellator.GLUhalfEdge eNewSym; + 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.sun.opengl.impl.glu.tessellator.GLUhalfEdge eNew = MakeEdge(eOrg); + com.jogamp.opengl.impl.glu.tessellator.GLUhalfEdge eNew = MakeEdge(eOrg); eNewSym = eNew.Sym; @@ -498,7 +498,7 @@ class Mesh { eOrg.Lface.anEdge = eNewSym; if (!joiningLoops) { - com.sun.opengl.impl.glu.tessellator.GLUface newFace = new com.sun.opengl.impl.glu.tessellator.GLUface(); + 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); @@ -516,10 +516,10 @@ class Mesh { * 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.sun.opengl.impl.glu.tessellator.GLUface fZap) { - com.sun.opengl.impl.glu.tessellator.GLUhalfEdge eStart = fZap.anEdge; - com.sun.opengl.impl.glu.tessellator.GLUhalfEdge e, eNext, eSym; - com.sun.opengl.impl.glu.tessellator.GLUface fPrev, fNext; + 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; @@ -561,12 +561,12 @@ class Mesh { /* __gl_meshNewMesh() creates a new mesh with no edges, no vertices, * and no loops (what we usually call a "face"). */ - public static com.sun.opengl.impl.glu.tessellator.GLUmesh __gl_meshNewMesh() { - com.sun.opengl.impl.glu.tessellator.GLUvertex v; - com.sun.opengl.impl.glu.tessellator.GLUface f; - com.sun.opengl.impl.glu.tessellator.GLUhalfEdge e; - com.sun.opengl.impl.glu.tessellator.GLUhalfEdge eSym; - com.sun.opengl.impl.glu.tessellator.GLUmesh mesh = new com.sun.opengl.impl.glu.tessellator.GLUmesh(); + 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; @@ -609,13 +609,13 @@ class 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.sun.opengl.impl.glu.tessellator.GLUmesh __gl_meshUnion(com.sun.opengl.impl.glu.tessellator.GLUmesh mesh1, com.sun.opengl.impl.glu.tessellator.GLUmesh mesh2) { - com.sun.opengl.impl.glu.tessellator.GLUface f1 = mesh1.fHead; - com.sun.opengl.impl.glu.tessellator.GLUvertex v1 = mesh1.vHead; - com.sun.opengl.impl.glu.tessellator.GLUhalfEdge e1 = mesh1.eHead; - com.sun.opengl.impl.glu.tessellator.GLUface f2 = mesh2.fHead; - com.sun.opengl.impl.glu.tessellator.GLUvertex v2 = mesh2.vHead; - com.sun.opengl.impl.glu.tessellator.GLUhalfEdge e2 = mesh2.eHead; + 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) { @@ -645,8 +645,8 @@ class Mesh { /* __gl_meshDeleteMesh( mesh ) will free all storage for any valid mesh. */ - static void __gl_meshDeleteMeshZap(com.sun.opengl.impl.glu.tessellator.GLUmesh mesh) { - com.sun.opengl.impl.glu.tessellator.GLUface fHead = mesh.fHead; + 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); @@ -656,10 +656,10 @@ class Mesh { /* __gl_meshDeleteMesh( mesh ) will free all storage for any valid mesh. */ - public static void __gl_meshDeleteMesh(com.sun.opengl.impl.glu.tessellator.GLUmesh mesh) { - com.sun.opengl.impl.glu.tessellator.GLUface f, fNext; - com.sun.opengl.impl.glu.tessellator.GLUvertex v, vNext; - com.sun.opengl.impl.glu.tessellator.GLUhalfEdge e, eNext; + 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; @@ -677,13 +677,13 @@ class Mesh { /* __gl_meshCheckMesh( mesh ) checks a mesh for self-consistency. */ - public static void __gl_meshCheckMesh(com.sun.opengl.impl.glu.tessellator.GLUmesh mesh) { - com.sun.opengl.impl.glu.tessellator.GLUface fHead = mesh.fHead; - com.sun.opengl.impl.glu.tessellator.GLUvertex vHead = mesh.vHead; - com.sun.opengl.impl.glu.tessellator.GLUhalfEdge eHead = mesh.eHead; - com.sun.opengl.impl.glu.tessellator.GLUface f, fPrev; - com.sun.opengl.impl.glu.tessellator.GLUvertex v, vPrev; - com.sun.opengl.impl.glu.tessellator.GLUhalfEdge e, ePrev; + 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) { diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/tessellator/Normal.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/Normal.java index feb13dfd4..fe1a20c49 100644 --- a/src/jogl/classes/com/sun/opengl/impl/glu/tessellator/Normal.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/Normal.java @@ -6,7 +6,7 @@ /* ** 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 1.1 (the "License"), the contents of this +** 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 @@ -50,7 +50,7 @@ ** Java Port: Pepijn Van Eeckhoudt, July 2003 ** Java Port: Nathan Parker Burg, August 2003 */ -package com.sun.opengl.impl.glu.tessellator; +package com.jogamp.opengl.impl.glu.tessellator; import javax.media.opengl.*; import javax.media.opengl.glu.*; @@ -110,17 +110,17 @@ class Normal { } static void ComputeNormal(GLUtessellatorImpl tess, double[] norm) { - com.sun.opengl.impl.glu.tessellator.GLUvertex v, v1, v2; + com.jogamp.opengl.impl.glu.tessellator.GLUvertex v, v1, v2; double c, tLen2, maxLen2; double[] maxVal, minVal, d1, d2, tNorm; - com.sun.opengl.impl.glu.tessellator.GLUvertex[] maxVert, minVert; - com.sun.opengl.impl.glu.tessellator.GLUvertex vHead = tess.mesh.vHead; + 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.sun.opengl.impl.glu.tessellator.GLUvertex[3]; - maxVert = new com.sun.opengl.impl.glu.tessellator.GLUvertex[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]; @@ -194,9 +194,9 @@ class Normal { static void CheckOrientation(GLUtessellatorImpl tess) { double area; - com.sun.opengl.impl.glu.tessellator.GLUface f, fHead = tess.mesh.fHead; - com.sun.opengl.impl.glu.tessellator.GLUvertex v, vHead = tess.mesh.vHead; - com.sun.opengl.impl.glu.tessellator.GLUhalfEdge e; + 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. @@ -225,7 +225,7 @@ class Normal { * of the polygon. */ public static void __gl_projectPolygon(GLUtessellatorImpl tess) { - com.sun.opengl.impl.glu.tessellator.GLUvertex v, vHead = tess.mesh.vHead; + com.jogamp.opengl.impl.glu.tessellator.GLUvertex v, vHead = tess.mesh.vHead; double w; double[] norm = new double[3]; double[] sUnit, tUnit; diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/tessellator/PriorityQ.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/PriorityQ.java index 18f2cf32c..b77305ae2 100644 --- a/src/jogl/classes/com/sun/opengl/impl/glu/tessellator/PriorityQ.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/PriorityQ.java @@ -6,7 +6,7 @@ /* ** 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 1.1 (the "License"), the contents of this +** 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 @@ -50,7 +50,7 @@ ** Java Port: Pepijn Van Eeckhoudt, July 2003 ** Java Port: Nathan Parker Burg, August 2003 */ -package com.sun.opengl.impl.glu.tessellator; +package com.jogamp.opengl.impl.glu.tessellator; abstract class PriorityQ { public static final int INIT_SIZE = 32; @@ -76,7 +76,7 @@ abstract class PriorityQ { /* Violates modularity, but a little faster */ // #include "geom.h" public static boolean LEQ(Leq leq, Object x, Object y) { - return com.sun.opengl.impl.glu.tessellator.Geom.VertLeq((com.sun.opengl.impl.glu.tessellator.GLUvertex) x, (com.sun.opengl.impl.glu.tessellator.GLUvertex) 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) { diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/tessellator/PriorityQHeap.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/PriorityQHeap.java index 2f856517a..61aa9574f 100644 --- a/src/jogl/classes/com/sun/opengl/impl/glu/tessellator/PriorityQHeap.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/PriorityQHeap.java @@ -6,7 +6,7 @@ /* ** 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 1.1 (the "License"), the contents of this +** 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 @@ -50,25 +50,25 @@ ** Java Port: Pepijn Van Eeckhoudt, July 2003 ** Java Port: Nathan Parker Burg, August 2003 */ -package com.sun.opengl.impl.glu.tessellator; +package com.jogamp.opengl.impl.glu.tessellator; -class PriorityQHeap extends com.sun.opengl.impl.glu.tessellator.PriorityQ { - com.sun.opengl.impl.glu.tessellator.PriorityQ.PQnode[] nodes; - com.sun.opengl.impl.glu.tessellator.PriorityQ.PQhandleElem[] handles; +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.sun.opengl.impl.glu.tessellator.PriorityQ.Leq leq; + com.jogamp.opengl.impl.glu.tessellator.PriorityQ.Leq leq; /* really __gl_pqHeapNewPriorityQ */ - public PriorityQHeap(com.sun.opengl.impl.glu.tessellator.PriorityQ.Leq leq) { + public PriorityQHeap(com.jogamp.opengl.impl.glu.tessellator.PriorityQ.Leq leq) { size = 0; - max = com.sun.opengl.impl.glu.tessellator.PriorityQ.INIT_SIZE; - nodes = new com.sun.opengl.impl.glu.tessellator.PriorityQ.PQnode[com.sun.opengl.impl.glu.tessellator.PriorityQ.INIT_SIZE + 1]; + 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.sun.opengl.impl.glu.tessellator.PriorityQ.PQhandleElem[com.sun.opengl.impl.glu.tessellator.PriorityQ.INIT_SIZE + 1]; + 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(); } @@ -87,8 +87,8 @@ class PriorityQHeap extends com.sun.opengl.impl.glu.tessellator.PriorityQ { } void FloatDown(int curr) { - com.sun.opengl.impl.glu.tessellator.PriorityQ.PQnode[] n = nodes; - com.sun.opengl.impl.glu.tessellator.PriorityQ.PQhandleElem[] h = handles; + 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; @@ -116,8 +116,8 @@ class PriorityQHeap extends com.sun.opengl.impl.glu.tessellator.PriorityQ { void FloatUp(int curr) { - com.sun.opengl.impl.glu.tessellator.PriorityQ.PQnode[] n = nodes; - com.sun.opengl.impl.glu.tessellator.PriorityQ.PQhandleElem[] h = handles; + 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; @@ -158,8 +158,8 @@ class PriorityQHeap extends com.sun.opengl.impl.glu.tessellator.PriorityQ { curr = ++size; if ((curr * 2) > max) { - com.sun.opengl.impl.glu.tessellator.PriorityQ.PQnode[] saveNodes = nodes; - com.sun.opengl.impl.glu.tessellator.PriorityQ.PQhandleElem[] saveHandles = handles; + 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; @@ -208,8 +208,8 @@ class PriorityQHeap extends com.sun.opengl.impl.glu.tessellator.PriorityQ { /* really __gl_pqHeapExtractMin */ Object pqExtractMin() { - com.sun.opengl.impl.glu.tessellator.PriorityQ.PQnode[] n = nodes; - com.sun.opengl.impl.glu.tessellator.PriorityQ.PQhandleElem[] h = handles; + 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; @@ -230,8 +230,8 @@ class PriorityQHeap extends com.sun.opengl.impl.glu.tessellator.PriorityQ { /* really __gl_pqHeapDelete */ void pqDelete(int hCurr) { - com.sun.opengl.impl.glu.tessellator.PriorityQ.PQnode[] n = nodes; - com.sun.opengl.impl.glu.tessellator.PriorityQ.PQhandleElem[] h = handles; + 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); diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/tessellator/PriorityQSort.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/PriorityQSort.java index 67924524d..f115b8f49 100644 --- a/src/jogl/classes/com/sun/opengl/impl/glu/tessellator/PriorityQSort.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/PriorityQSort.java @@ -1,7 +1,7 @@ /* ** 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 1.1 (the "License"), the contents of this +** 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 @@ -45,10 +45,10 @@ ** Java Port: Pepijn Van Eeckhoudt, July 2003 ** Java Port: Nathan Parker Burg, August 2003 */ -package com.sun.opengl.impl.glu.tessellator; +package com.jogamp.opengl.impl.glu.tessellator; -class PriorityQSort extends com.sun.opengl.impl.glu.tessellator.PriorityQ { - com.sun.opengl.impl.glu.tessellator.PriorityQHeap heap; +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. @@ -57,15 +57,15 @@ class PriorityQSort extends com.sun.opengl.impl.glu.tessellator.PriorityQ { int[] order; int size, max; boolean initialized; - com.sun.opengl.impl.glu.tessellator.PriorityQ.Leq leq; + com.jogamp.opengl.impl.glu.tessellator.PriorityQ.Leq leq; - public PriorityQSort(com.sun.opengl.impl.glu.tessellator.PriorityQ.Leq leq) { - heap = new com.sun.opengl.impl.glu.tessellator.PriorityQHeap(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.sun.opengl.impl.glu.tessellator.PriorityQ.INIT_SIZE]; + keys = new Object[com.jogamp.opengl.impl.glu.tessellator.PriorityQ.INIT_SIZE]; size = 0; - max = com.sun.opengl.impl.glu.tessellator.PriorityQ.INIT_SIZE; + max = com.jogamp.opengl.impl.glu.tessellator.PriorityQ.INIT_SIZE; initialized = false; this.leq = leq; } @@ -77,12 +77,12 @@ class PriorityQSort extends com.sun.opengl.impl.glu.tessellator.PriorityQ { keys = null; } - private static boolean LT(com.sun.opengl.impl.glu.tessellator.PriorityQ.Leq leq, Object x, Object y) { - return (!com.sun.opengl.impl.glu.tessellator.PriorityQHeap.LEQ(leq, y, x)); + 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.sun.opengl.impl.glu.tessellator.PriorityQ.Leq leq, Object x, Object y) { - return (!com.sun.opengl.impl.glu.tessellator.PriorityQHeap.LEQ(leq, x, y)); + 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) { @@ -249,7 +249,7 @@ class PriorityQSort extends com.sun.opengl.impl.glu.tessellator.PriorityQ { sortMin = keys[order[size - 1]]; if (!heap.pqIsEmpty()) { heapMin = heap.pqMinimum(); - if (com.sun.opengl.impl.glu.tessellator.PriorityQHeap.LEQ(leq, heapMin, sortMin)) { + if (com.jogamp.opengl.impl.glu.tessellator.PriorityQHeap.LEQ(leq, heapMin, sortMin)) { return heapMin; } } diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/tessellator/Render.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/Render.java index cd6e02255..9761200e0 100644 --- a/src/jogl/classes/com/sun/opengl/impl/glu/tessellator/Render.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/Render.java @@ -6,7 +6,7 @@ /* ** 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 1.1 (the "License"), the contents of this +** 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 @@ -50,7 +50,7 @@ ** Java Port: Pepijn Van Eeckhoudt, July 2003 ** Java Port: Nathan Parker Burg, August 2003 */ -package com.sun.opengl.impl.glu.tessellator; +package com.jogamp.opengl.impl.glu.tessellator; import javax.media.opengl.*; import javax.media.opengl.glu.*; @@ -73,19 +73,19 @@ class Render { public FaceCount() { } - public FaceCount(long size, com.sun.opengl.impl.glu.tessellator.GLUhalfEdge eStart, renderCallBack render) { + 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.sun.opengl.impl.glu.tessellator.GLUhalfEdge eStart; /* edge where this primitive starts */ + com.jogamp.opengl.impl.glu.tessellator.GLUhalfEdge eStart; /* edge where this primitive starts */ renderCallBack render; }; private static interface renderCallBack { - void render(GLUtessellatorImpl tess, com.sun.opengl.impl.glu.tessellator.GLUhalfEdge e, long size); + void render(GLUtessellatorImpl tess, com.jogamp.opengl.impl.glu.tessellator.GLUhalfEdge e, long size); } /************************ Strips and Fans decomposition ******************/ @@ -97,8 +97,8 @@ class Render { * * The rendering output is provided as callbacks (see the api). */ - public static void __gl_renderMesh(GLUtessellatorImpl tess, com.sun.opengl.impl.glu.tessellator.GLUmesh mesh) { - com.sun.opengl.impl.glu.tessellator.GLUface f; + 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; @@ -124,7 +124,7 @@ class Render { } - static void RenderMaximumFaceGroup(GLUtessellatorImpl tess, com.sun.opengl.impl.glu.tessellator.GLUface fOrig) { + 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 @@ -132,7 +132,7 @@ class Render { * is to try all of these, and take the primitive which uses the most * triangles (a greedy approach). */ - com.sun.opengl.impl.glu.tessellator.GLUhalfEdge e = fOrig.anEdge; + com.jogamp.opengl.impl.glu.tessellator.GLUhalfEdge e = fOrig.anEdge; FaceCount max = new FaceCount(); FaceCount newFace = new FaceCount(); @@ -178,17 +178,17 @@ class Render { * more complicated, and we need a general tracking method like the * one here. */ - private static boolean Marked(com.sun.opengl.impl.glu.tessellator.GLUface f) { + private static boolean Marked(com.jogamp.opengl.impl.glu.tessellator.GLUface f) { return !f.inside || f.marked; } - private static GLUface AddToTrail(com.sun.opengl.impl.glu.tessellator.GLUface f, com.sun.opengl.impl.glu.tessellator.GLUface t) { + 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.sun.opengl.impl.glu.tessellator.GLUface t) { + private static void FreeTrail(com.jogamp.opengl.impl.glu.tessellator.GLUface t) { if (true) { while (t != null) { t.marked = false; @@ -199,14 +199,14 @@ class Render { } } - static FaceCount MaximumFan(com.sun.opengl.impl.glu.tessellator.GLUhalfEdge eOrig) { + 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.sun.opengl.impl.glu.tessellator.GLUface trail = null; - com.sun.opengl.impl.glu.tessellator.GLUhalfEdge e; + 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); @@ -227,7 +227,7 @@ class Render { return (n & 0x1L) == 0; } - static FaceCount MaximumStrip(com.sun.opengl.impl.glu.tessellator.GLUhalfEdge eOrig) { + 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). @@ -240,8 +240,8 @@ class Render { */ FaceCount newFace = new FaceCount(0, null, renderStrip); long headSize = 0, tailSize = 0; - com.sun.opengl.impl.glu.tessellator.GLUface trail = null; - com.sun.opengl.impl.glu.tessellator.GLUhalfEdge e, eTail, eHead; + 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); @@ -279,7 +279,7 @@ class Render { } private static class RenderTriangle implements renderCallBack { - public void render(GLUtessellatorImpl tess, com.sun.opengl.impl.glu.tessellator.GLUhalfEdge e, long size) { + 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. */ @@ -289,11 +289,11 @@ class Render { } - static void RenderLonelyTriangles(GLUtessellatorImpl tess, com.sun.opengl.impl.glu.tessellator.GLUface f) { + 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.sun.opengl.impl.glu.tessellator.GLUhalfEdge e; + com.jogamp.opengl.impl.glu.tessellator.GLUhalfEdge e; int newState; int edgeState = -1; /* force edge state output for first vertex */ @@ -323,7 +323,7 @@ class Render { } private static class RenderFan implements renderCallBack { - public void render(GLUtessellatorImpl tess, com.sun.opengl.impl.glu.tessellator.GLUhalfEdge e, long size) { + 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). @@ -345,7 +345,7 @@ class Render { } private static class RenderStrip implements renderCallBack { - public void render(GLUtessellatorImpl tess, com.sun.opengl.impl.glu.tessellator.GLUhalfEdge e, long size) { + 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). @@ -378,9 +378,9 @@ class Render { * contour for each face marked "inside". The rendering output is * provided as callbacks (see the api). */ - public static void __gl_renderBoundary(GLUtessellatorImpl tess, com.sun.opengl.impl.glu.tessellator.GLUmesh mesh) { - com.sun.opengl.impl.glu.tessellator.GLUface f; - com.sun.opengl.impl.glu.tessellator.GLUhalfEdge e; + 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) { @@ -409,7 +409,7 @@ class Render { * are degenerate return 0; otherwise (no consistent orientation) return * SIGN_INCONSISTENT. */ { - com.sun.opengl.impl.glu.tessellator.CachedVertex[] v = tess.cache; + com.jogamp.opengl.impl.glu.tessellator.CachedVertex[] v = tess.cache; // CachedVertex vn = v0 + tess.cacheCount; int vn = tess.cacheCount; // CachedVertex vc; @@ -488,7 +488,7 @@ class Render { * output is provided as callbacks (see the api). */ public static boolean __gl_renderCache(GLUtessellatorImpl tess) { - com.sun.opengl.impl.glu.tessellator.CachedVertex[] v = tess.cache; + com.jogamp.opengl.impl.glu.tessellator.CachedVertex[] v = tess.cache; // CachedVertex vn = v0 + tess.cacheCount; int vn = tess.cacheCount; // CachedVertex vc; diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/tessellator/Sweep.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/Sweep.java index 105328d87..8ffeadb67 100644 --- a/src/jogl/classes/com/sun/opengl/impl/glu/tessellator/Sweep.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/Sweep.java @@ -6,7 +6,7 @@ /* ** 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 1.1 (the "License"), the contents of this +** 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 @@ -50,7 +50,7 @@ ** Java Port: Pepijn Van Eeckhoudt, July 2003 ** Java Port: Nathan Parker Burg, August 2003 */ -package com.sun.opengl.impl.glu.tessellator; +package com.jogamp.opengl.impl.glu.tessellator; import javax.media.opengl.*; import javax.media.opengl.glu.*; diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/tessellator/TessMono.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/TessMono.java index fe0f7946c..ef89b1613 100644 --- a/src/jogl/classes/com/sun/opengl/impl/glu/tessellator/TessMono.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/TessMono.java @@ -6,7 +6,7 @@ /* ** 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 1.1 (the "License"), the contents of this +** 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 @@ -50,7 +50,7 @@ ** Java Port: Pepijn Van Eeckhoudt, July 2003 ** Java Port: Nathan Parker Burg, August 2003 */ -package com.sun.opengl.impl.glu.tessellator; +package com.jogamp.opengl.impl.glu.tessellator; class TessMono { /* __gl_meshTessellateMonoRegion( face ) tessellates a monotone region diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/tessellator/TessState.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/TessState.java index 9cf192529..a8aa41d9f 100644 --- a/src/jogl/classes/com/sun/opengl/impl/glu/tessellator/TessState.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/glu/tessellator/TessState.java @@ -6,7 +6,7 @@ /* ** 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 1.1 (the "License"), the contents of this +** 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 @@ -50,7 +50,7 @@ ** Java Port: Pepijn Van Eeckhoudt, July 2003 ** Java Port: Nathan Parker Burg, August 2003 */ -package com.sun.opengl.impl.glu.tessellator; +package com.jogamp.opengl.impl.glu.tessellator; class TessState { public static final int T_DORMANT = 0; diff --git a/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXCGLContext.java b/src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/MacOSXCGLContext.java index ef3e9f930..ebefaf466 100644 --- a/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXCGLContext.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/MacOSXCGLContext.java @@ -37,14 +37,14 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.impl.macosx.cgl; +package com.jogamp.opengl.impl.macosx.cgl; import java.nio.*; import java.util.*; import javax.media.opengl.*; import javax.media.nativewindow.*; -import com.sun.opengl.impl.*; -import com.sun.gluegen.runtime.ProcAddressTable; +import com.jogamp.opengl.impl.*; +import com.jogamp.gluegen.runtime.ProcAddressTable; public abstract class MacOSXCGLContext extends GLContextImpl { @@ -84,17 +84,17 @@ public abstract class MacOSXCGLContext extends GLContextImpl return cglExtProcAddressTable; } - protected String mapToRealGLFunctionName(String glFunctionName) - { - return glFunctionName; + 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 String mapToRealGLExtensionName(String glExtensionName) - { - return glExtensionName; + + protected void destroyContextARBImpl(long _context) { + // FIXME } - - protected abstract boolean create(); /** * Creates and initializes an appropriate OpenGl nsContext. Should only be @@ -156,27 +156,25 @@ public abstract class MacOSXCGLContext extends GLContextImpl if (!CGL.makeCurrentContext(nsContext)) { throw new GLException("Error making nsContext current"); } - setGLFunctionAvailability(true); + setGLFunctionAvailability(true, 0, 0, CTX_PROFILE_COMPAT|CTX_OPTION_ANY); GLContextShareSet.contextCreated(this); return true; } protected int makeCurrentImpl() throws GLException { if (0 == cglContext && drawable.getNativeWindow().getSurfaceHandle() == 0) { - if (DEBUG) { - System.err.println("drawable not properly initialized"); - } - return CONTEXT_NOT_CURRENT; + throw new GLException("drawable not properly initialized: "+drawable); } boolean created = false; if ( 0 == cglContext && 0 == nsContext) { - if (!create()) { + create(); + created = 0 != cglContext || 0 != nsContext ; + if(!created) { return CONTEXT_NOT_CURRENT; } if (DEBUG) { System.err.println("!!! Created OpenGL context " + toHexString(nsContext) + " for " + getClass().getName()); } - created = true; } if ( 0 != cglContext ) { @@ -190,7 +188,7 @@ public abstract class MacOSXCGLContext extends GLContextImpl } if (created) { - setGLFunctionAvailability(false); + setGLFunctionAvailability(false, -1, -1, CTX_PROFILE_COMPAT|CTX_OPTION_ANY); return CONTEXT_CURRENT_NEW; } return CONTEXT_CURRENT; @@ -257,7 +255,7 @@ public abstract class MacOSXCGLContext extends GLContextImpl } } - protected void updateGLProcAddressTable() { + protected void updateGLProcAddressTable(int major, int minor, int ctp) { if (DEBUG) { System.err.println("!!! Initializing CGL extension address table"); } @@ -267,7 +265,7 @@ public abstract class MacOSXCGLContext extends GLContextImpl cglExtProcAddressTable = new CGLExtProcAddressTable(); } resetProcAddressTable(getCGLExtProcAddressTable()); - super.updateGLProcAddressTable(); + super.updateGLProcAddressTable(major, minor, ctp); } public String getPlatformExtensionsString() diff --git a/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXCGLDrawable.java b/src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/MacOSXCGLDrawable.java index b417668da..cf29d214b 100644 --- a/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXCGLDrawable.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/MacOSXCGLDrawable.java @@ -37,12 +37,12 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.impl.macosx.cgl; +package com.jogamp.opengl.impl.macosx.cgl; import javax.media.nativewindow.*; import javax.media.opengl.*; -import com.sun.opengl.impl.*; -import com.sun.gluegen.runtime.DynamicLookupHelper; +import com.jogamp.opengl.impl.*; +import com.jogamp.common.os.DynamicLookupHelper; public abstract class MacOSXCGLDrawable extends GLDrawableImpl { // The Java2D/OpenGL pipeline on OS X uses low-level CGLContextObjs @@ -87,11 +87,8 @@ public abstract class MacOSXCGLDrawable extends GLDrawableImpl { if( NativeWindow.LOCK_SURFACE_NOT_READY == lockSurface() ) { throw new GLException("Couldn't lock surface"); } - try { - // don't remove this block .. locking the surface is essential to update surface data - } finally { - unlockSurface(); - } + // locking the surface is essential to update surface data + unlockSurface(); } } diff --git a/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXCGLDrawableFactory.java b/src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/MacOSXCGLDrawableFactory.java index be18ee2da..d10434252 100644 --- a/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXCGLDrawableFactory.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/MacOSXCGLDrawableFactory.java @@ -37,16 +37,16 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.impl.macosx.cgl; +package com.jogamp.opengl.impl.macosx.cgl; -import java.lang.reflect.InvocationTargetException; +import com.jogamp.common.os.DynamicLookupHelper; import java.nio.*; -import java.util.*; import javax.media.nativewindow.*; import javax.media.opengl.*; -import com.sun.opengl.impl.*; -import com.sun.nativewindow.impl.*; -import com.sun.gluegen.runtime.DynamicLookupHelper; +import com.jogamp.common.JogampRuntimeException; +import com.jogamp.common.util.*; +import com.jogamp.opengl.impl.*; +import com.jogamp.nativewindow.impl.NullWindow; public class MacOSXCGLDrawableFactory extends GLDrawableFactoryImpl implements DynamicLookupHelper { public MacOSXCGLDrawableFactory() { @@ -57,11 +57,14 @@ public class MacOSXCGLDrawableFactory extends GLDrawableFactoryImpl implements D new MacOSXCGLGraphicsConfigurationFactory(); try { - NWReflection.createInstance("com.sun.opengl.impl.macosx.cgl.awt.MacOSXAWTCGLGraphicsConfigurationFactory", + ReflectionUtil.createInstance("com.jogamp.opengl.impl.macosx.cgl.awt.MacOSXAWTCGLGraphicsConfigurationFactory", new Object[] {}); - } catch (Throwable t) { } + } catch (JogampRuntimeException jre) { /* n/a .. */ } } + protected final GLDrawableImpl getSharedDrawable() { return null; } + protected final GLContextImpl getSharedContext() { return null; } + public GLDrawableImpl createOnscreenDrawable(NativeWindow target) { if (target == null) { throw new IllegalArgumentException("Null target"); @@ -73,7 +76,7 @@ public class MacOSXCGLDrawableFactory extends GLDrawableFactoryImpl implements D return new MacOSXOffscreenCGLDrawable(this, target); } - public boolean canCreateGLPbuffer() { + public boolean canCreateGLPbuffer(AbstractGraphicsDevice device) { return true; } @@ -105,7 +108,7 @@ public class MacOSXCGLDrawableFactory extends GLDrawableFactoryImpl implements D return MacOSXExternalCGLContext.create(this, null); } - public boolean canCreateExternalGLDrawable() { + public boolean canCreateExternalGLDrawable(AbstractGraphicsDevice device) { return false; } @@ -123,7 +126,7 @@ public class MacOSXCGLDrawableFactory extends GLDrawableFactoryImpl implements D return CGL.getProcAddress(glFuncName); } - public boolean canCreateContextOnJava2DSurface() { + public boolean canCreateContextOnJava2DSurface(AbstractGraphicsDevice device) { return false; } diff --git a/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXCGLGraphicsConfiguration.java b/src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/MacOSXCGLGraphicsConfiguration.java index c94efc92b..889d1c333 100644 --- a/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXCGLGraphicsConfiguration.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/MacOSXCGLGraphicsConfiguration.java @@ -33,13 +33,10 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.impl.macosx.cgl; +package com.jogamp.opengl.impl.macosx.cgl; -import java.util.*; import javax.media.nativewindow.*; import javax.media.opengl.*; -import com.sun.opengl.impl.*; -import com.sun.gluegen.runtime.NativeLibrary; public class MacOSXCGLGraphicsConfiguration extends DefaultGraphicsConfiguration implements Cloneable { long pixelformat; diff --git a/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXCGLGraphicsConfigurationFactory.java b/src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/MacOSXCGLGraphicsConfigurationFactory.java index 7c2c7b751..ada5fb1a7 100644 --- a/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXCGLGraphicsConfigurationFactory.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/MacOSXCGLGraphicsConfigurationFactory.java @@ -30,14 +30,14 @@ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ -package com.sun.opengl.impl.macosx.cgl; +package com.jogamp.opengl.impl.macosx.cgl; import javax.media.nativewindow.*; import javax.media.nativewindow.macosx.*; -import com.sun.nativewindow.impl.*; +import com.jogamp.nativewindow.impl.*; import javax.media.opengl.*; -import com.sun.opengl.impl.*; +import com.jogamp.opengl.impl.*; /** Subclass of GraphicsConfigurationFactory used when non-AWT tookits are used on OSX platforms. Toolkits will likely need to delegate @@ -45,7 +45,7 @@ import com.sun.opengl.impl.*; GraphicsDevice and GraphicsConfiguration abstractions. */ public class MacOSXCGLGraphicsConfigurationFactory extends GraphicsConfigurationFactory { - protected static final boolean DEBUG = com.sun.opengl.impl.Debug.debug("GraphicsConfiguration"); + protected static final boolean DEBUG = com.jogamp.opengl.impl.Debug.debug("GraphicsConfiguration"); public MacOSXCGLGraphicsConfigurationFactory() { GraphicsConfigurationFactory.registerFactory(javax.media.nativewindow.macosx.MacOSXGraphicsDevice.class, this); diff --git a/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXExternalCGLContext.java b/src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/MacOSXExternalCGLContext.java index 0e468e5c5..eba3cf50e 100644 --- a/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXExternalCGLContext.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/MacOSXExternalCGLContext.java @@ -37,13 +37,13 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.impl.macosx.cgl; +package com.jogamp.opengl.impl.macosx.cgl; import javax.media.opengl.*; -import com.sun.opengl.impl.*; +import com.jogamp.opengl.impl.*; import javax.media.nativewindow.*; -import com.sun.nativewindow.impl.NullWindow; +import com.jogamp.nativewindow.impl.NullWindow; public class MacOSXExternalCGLContext extends MacOSXCGLContext { private boolean firstMakeCurrent = true; @@ -56,7 +56,7 @@ public class MacOSXExternalCGLContext extends MacOSXCGLContext { this.cglContext = cglContext; this.nsContext = nsContext; GLContextShareSet.contextCreated(this); - setGLFunctionAvailability(false); + setGLFunctionAvailability(false, 0, 0, CTX_PROFILE_COMPAT|CTX_OPTION_ANY); getGLStateTracker().setEnabled(false); // external context usage can't track state in Java } @@ -110,8 +110,7 @@ public class MacOSXExternalCGLContext extends MacOSXCGLContext { } } - protected boolean create() { - return true; + protected void create() { } public int makeCurrent() throws GLException { diff --git a/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXOffscreenCGLContext.java b/src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/MacOSXOffscreenCGLContext.java index b60c48237..89e293665 100644 --- a/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXOffscreenCGLContext.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/MacOSXOffscreenCGLContext.java @@ -37,10 +37,10 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.impl.macosx.cgl; +package com.jogamp.opengl.impl.macosx.cgl; import javax.media.opengl.*; -import com.sun.opengl.impl.*; +import com.jogamp.opengl.impl.*; public class MacOSXOffscreenCGLContext extends MacOSXPbufferCGLContext { @@ -51,7 +51,7 @@ public class MacOSXOffscreenCGLContext extends MacOSXPbufferCGLContext public int getOffscreenContextPixelDataType() { GL gl = getGL(); - return gl.isGL2()?GL2.GL_UNSIGNED_INT_8_8_8_8_REV:GL.GL_UNSIGNED_SHORT_5_5_5_1; + return gl.isGL2GL3()?GL2GL3.GL_UNSIGNED_INT_8_8_8_8_REV:GL.GL_UNSIGNED_SHORT_5_5_5_1; } public int getOffscreenContextReadBuffer() { diff --git a/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXOffscreenCGLDrawable.java b/src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/MacOSXOffscreenCGLDrawable.java index 3448b008a..adaa48f34 100644 --- a/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXOffscreenCGLDrawable.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/MacOSXOffscreenCGLDrawable.java @@ -37,11 +37,11 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.impl.macosx.cgl; +package com.jogamp.opengl.impl.macosx.cgl; import javax.media.opengl.*; import javax.media.nativewindow.*; -import com.sun.opengl.impl.*; +import com.jogamp.opengl.impl.*; public class MacOSXOffscreenCGLDrawable extends MacOSXPbufferCGLDrawable { diff --git a/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXOnscreenCGLContext.java b/src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/MacOSXOnscreenCGLContext.java index 4a3e0a8eb..c4eaee489 100644 --- a/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXOnscreenCGLContext.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/MacOSXOnscreenCGLContext.java @@ -37,13 +37,13 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.impl.macosx.cgl; +package com.jogamp.opengl.impl.macosx.cgl; import java.util.*; import javax.media.nativewindow.*; import javax.media.opengl.*; -import com.sun.opengl.impl.*; +import com.jogamp.opengl.impl.*; public class MacOSXOnscreenCGLContext extends MacOSXCGLContext { protected MacOSXOnscreenCGLDrawable drawable; @@ -115,8 +115,8 @@ public class MacOSXOnscreenCGLContext extends MacOSXCGLContext { CGL.updateContext(nsContext); } - protected boolean create() { - return create(false, false); + protected void create() { + create(false, false); } public void setOpenGLMode(int mode) { diff --git a/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXOnscreenCGLDrawable.java b/src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/MacOSXOnscreenCGLDrawable.java index 56951ae10..6ee023867 100644 --- a/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXOnscreenCGLDrawable.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/MacOSXOnscreenCGLDrawable.java @@ -37,7 +37,7 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.impl.macosx.cgl; +package com.jogamp.opengl.impl.macosx.cgl; import java.lang.ref.WeakReference; import java.security.*; @@ -45,7 +45,7 @@ import java.util.*; import javax.media.nativewindow.*; import javax.media.opengl.*; -import com.sun.opengl.impl.*; +import com.jogamp.opengl.impl.*; public class MacOSXOnscreenCGLDrawable extends MacOSXCGLDrawable { private List/*<WeakReference<GLContext>>*/ createdContexts = diff --git a/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXPbufferCGLContext.java b/src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/MacOSXPbufferCGLContext.java index 0754c4b57..52a892b70 100644 --- a/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXPbufferCGLContext.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/MacOSXPbufferCGLContext.java @@ -1,11 +1,12 @@ -package com.sun.opengl.impl.macosx.cgl; +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.sun.opengl.impl.*; +import com.jogamp.opengl.impl.*; public class MacOSXPbufferCGLContext extends MacOSXCGLContext { protected MacOSXPbufferCGLDrawable drawable; @@ -58,13 +59,14 @@ public class MacOSXPbufferCGLContext extends MacOSXCGLContext { boolean created = false; if (nsContext == 0) { - if (!create()) { + create(); + created = 0 != nsContext ; + if(!created) { return CONTEXT_NOT_CURRENT; } if (DEBUG) { System.err.println("!!! Created OpenGL context " + toHexString(nsContext) + " for " + getClass().getName()); } - created = true; } if (!impl.makeCurrent(nsContext)) { @@ -72,13 +74,13 @@ public class MacOSXPbufferCGLContext extends MacOSXCGLContext { } if (created) { - setGLFunctionAvailability(false); + setGLFunctionAvailability(false, -1, -1, CTX_PROFILE_COMPAT|CTX_OPTION_ANY); // Initialize render-to-texture support if requested DefaultGraphicsConfiguration config = (DefaultGraphicsConfiguration) drawable.getNativeWindow().getGraphicsConfiguration().getNativeGraphicsConfiguration(); GLCapabilities capabilities = (GLCapabilities)config.getChosenCapabilities(); GL gl = getGL(); - boolean rect = gl.isGL2() && capabilities.getPbufferRenderToTextureRectangle(); + 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 " + @@ -133,7 +135,7 @@ public class MacOSXPbufferCGLContext extends MacOSXCGLContext { return GLPbuffer.APPLE_FLOAT; } - protected boolean create() { + protected void create() { DefaultGraphicsConfiguration config = (DefaultGraphicsConfiguration) drawable.getNativeWindow().getGraphicsConfiguration().getNativeGraphicsConfiguration(); GLCapabilities capabilities = (GLCapabilities)config.getChosenCapabilities(); if (capabilities.getPbufferFloatingPointBuffers() && @@ -151,9 +153,7 @@ public class MacOSXPbufferCGLContext extends MacOSXCGLContext { if (!impl.makeCurrent(nsContext)) { throw new GLException("Error making nsContext current"); } - setGLFunctionAvailability(true); - - return true; + setGLFunctionAvailability(true, 0, 0, CTX_PROFILE_COMPAT|CTX_OPTION_ANY); } //--------------------------------------------------------------------------- @@ -312,29 +312,29 @@ public class MacOSXPbufferCGLContext extends MacOSXCGLContext { } // Use attribute array to select pixel format - long[] fmt = new long[1]; + PointerBuffer fmt = PointerBuffer.allocateDirect(1); long[] numScreens = new long[1]; - int res = CGL.CGLChoosePixelFormat(attrs, 0, fmt, 0, numScreens, 0); + 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 - long[] ctx = new long[1]; + PointerBuffer ctx = PointerBuffer.allocateDirect(1); if (DEBUG) { System.err.println("Share context for CGL-based pbuffer context is " + toHexString(share)); } - res = CGL.CGLCreateContext(fmt[0], share, ctx, 0); - CGL.CGLDestroyPixelFormat(fmt[0]); + 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[0], drawable.getPbuffer(), 0, 0, 0); + res = CGL.CGLSetPBuffer(ctx.get(0), drawable.getPbuffer(), 0, 0, 0); if (res != CGL.kCGLNoError) { throw new GLException("Error code " + res + " while attaching context to pbuffer"); } - return ctx[0]; + return ctx.get(0); } public boolean destroy(long ctx) { diff --git a/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXPbufferCGLDrawable.java b/src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/MacOSXPbufferCGLDrawable.java index f57952b7c..afdc40dbb 100644 --- a/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXPbufferCGLDrawable.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/MacOSXPbufferCGLDrawable.java @@ -37,11 +37,12 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.impl.macosx.cgl; +package com.jogamp.opengl.impl.macosx.cgl; +import com.jogamp.common.nio.PointerBuffer; import javax.media.opengl.*; import javax.media.nativewindow.*; -import com.sun.opengl.impl.*; +import com.jogamp.opengl.impl.*; public class MacOSXPbufferCGLDrawable extends MacOSXCGLDrawable { private static final boolean DEBUG = Debug.debug("MacOSXPbufferCGLDrawable"); @@ -111,7 +112,7 @@ public class MacOSXPbufferCGLDrawable extends MacOSXCGLDrawable { GLCapabilities capabilities = (GLCapabilities)config.getChosenCapabilities(); GLProfile glProfile = capabilities.getGLProfile(); int renderTarget; - if (glProfile.isGL2() && capabilities.getPbufferRenderToTextureRectangle()) { + if (glProfile.isGL2GL3() && capabilities.getPbufferRenderToTextureRectangle()) { renderTarget = GL2.GL_TEXTURE_RECTANGLE; } else { int w = getNextPowerOf2(getWidth()); @@ -131,7 +132,7 @@ public class MacOSXPbufferCGLDrawable extends MacOSXCGLDrawable { throw new GLException("Floating-point support (GL_APPLE_float_pixels) not available"); } */ - if(glProfile.isGL2()) { + if(glProfile.isGL2GL3()) { switch (capabilities.getRedBits()) { case 16: internalFormat = GL2.GL_RGBA_FLOAT16_APPLE; break; case 32: internalFormat = GL2.GL_RGBA_FLOAT32_APPLE; break; @@ -232,12 +233,12 @@ public class MacOSXPbufferCGLDrawable extends MacOSXCGLDrawable { // CGL implementation class CGLImpl implements Impl { public long create(int renderTarget, int internalFormat, int width, int height) { - long[] pbuffer = new long[1]; - int res = CGL.CGLCreatePBuffer(width, height, renderTarget, internalFormat, 0, pbuffer, 0); + 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[0]; + return pbuffer.get(0); } public void destroy(long pbuffer) { diff --git a/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/awt/MacOSXAWTCGLDrawableFactory.java b/src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/awt/MacOSXAWTCGLDrawableFactory.java index d100ab442..eff01ca18 100644 --- a/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/awt/MacOSXAWTCGLDrawableFactory.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/awt/MacOSXAWTCGLDrawableFactory.java @@ -37,15 +37,16 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.impl.macosx.cgl.awt; +package com.jogamp.opengl.impl.macosx.cgl.awt; import java.lang.reflect.InvocationTargetException; import java.nio.*; import java.util.*; +import javax.media.nativewindow.*; import javax.media.opengl.*; -import com.sun.opengl.impl.*; -import com.sun.opengl.impl.awt.*; -import com.sun.opengl.impl.macosx.cgl.*; +import com.jogamp.opengl.impl.*; +import com.jogamp.opengl.impl.awt.*; +import com.jogamp.opengl.impl.macosx.cgl.*; public class MacOSXAWTCGLDrawableFactory extends MacOSXCGLDrawableFactory { @@ -53,7 +54,7 @@ public class MacOSXAWTCGLDrawableFactory extends MacOSXCGLDrawableFactory { super(); } - public boolean canCreateContextOnJava2DSurface() { + public boolean canCreateContextOnJava2DSurface(AbstractGraphicsDevice device) { return true; } diff --git a/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/awt/MacOSXAWTCGLGraphicsConfigurationFactory.java b/src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/awt/MacOSXAWTCGLGraphicsConfigurationFactory.java index 5e43eea49..0d59da32e 100644 --- a/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/awt/MacOSXAWTCGLGraphicsConfigurationFactory.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/awt/MacOSXAWTCGLGraphicsConfigurationFactory.java @@ -30,7 +30,7 @@ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ -package com.sun.opengl.impl.macosx.cgl.awt; +package com.jogamp.opengl.impl.macosx.cgl.awt; import java.awt.GraphicsConfiguration; import java.awt.GraphicsDevice; @@ -41,13 +41,13 @@ import javax.media.nativewindow.awt.*; import javax.media.opengl.*; import javax.media.opengl.awt.*; -import com.sun.opengl.impl.*; -import com.sun.opengl.impl.macosx.cgl.*; -import com.sun.nativewindow.impl.jawt.*; -import com.sun.nativewindow.impl.jawt.macosx.*; +import com.jogamp.opengl.impl.*; +import com.jogamp.opengl.impl.macosx.cgl.*; +import com.jogamp.nativewindow.impl.jawt.*; +import com.jogamp.nativewindow.impl.jawt.macosx.*; public class MacOSXAWTCGLGraphicsConfigurationFactory extends GraphicsConfigurationFactory { - protected static final boolean DEBUG = com.sun.opengl.impl.Debug.debug("GraphicsConfiguration"); + protected static final boolean DEBUG = com.jogamp.opengl.impl.Debug.debug("GraphicsConfiguration"); public MacOSXAWTCGLGraphicsConfigurationFactory() { GraphicsConfigurationFactory.registerFactory(javax.media.nativewindow.awt.AWTGraphicsDevice.class, this); diff --git a/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/awt/MacOSXJava2DCGLContext.java b/src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/awt/MacOSXJava2DCGLContext.java index 22b0ffe55..97a1435bc 100644 --- a/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/awt/MacOSXJava2DCGLContext.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/awt/MacOSXJava2DCGLContext.java @@ -37,15 +37,15 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.impl.macosx.cgl.awt; +package com.jogamp.opengl.impl.macosx.cgl.awt; -import com.sun.opengl.impl.macosx.cgl.*; +import com.jogamp.opengl.impl.macosx.cgl.*; import java.awt.Graphics; import javax.media.opengl.*; -import com.sun.opengl.impl.*; -import com.sun.opengl.impl.awt.*; -import com.sun.opengl.impl.macosx.cgl.*; +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 @@ -73,7 +73,9 @@ public class MacOSXJava2DCGLContext extends MacOSXCGLContext implements Java2DGL protected int makeCurrentImpl() throws GLException { boolean created = false; if (nsContext == 0) { - if (!create()) { + create(); + created = 0 != nsContext ; + if(!created) { return CONTEXT_NOT_CURRENT; } if (DEBUG) { @@ -87,13 +89,13 @@ public class MacOSXJava2DCGLContext extends MacOSXCGLContext implements Java2DGL } if (created) { - setGLFunctionAvailability(false); + setGLFunctionAvailability(false, -1, -1, CTX_PROFILE_COMPAT|CTX_OPTION_ANY); return CONTEXT_CURRENT_NEW; } return CONTEXT_CURRENT; } - protected boolean create() { + protected void create() { // Find and configure share context MacOSXCGLContext other = (MacOSXCGLContext) GLContextShareSet.getShareContext(this); long share = 0; @@ -119,11 +121,10 @@ public class MacOSXJava2DCGLContext extends MacOSXCGLContext implements Java2DGL long ctx = Java2D.createOGLContextOnSurface(graphics, share); if (ctx == 0) { - return false; + return; } // FIXME: think about GLContext sharing nsContext = ctx; - return true; } protected void releaseImpl() throws GLException { diff --git a/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsDummyWGLDrawable.java b/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsDummyWGLDrawable.java index f1e9483cd..87a37da04 100644 --- a/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsDummyWGLDrawable.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsDummyWGLDrawable.java @@ -37,17 +37,17 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.impl.windows.wgl; +package com.jogamp.opengl.impl.windows.wgl; import javax.media.opengl.*; -import com.sun.opengl.impl.*; -import com.sun.nativewindow.impl.NullWindow; +import com.jogamp.opengl.impl.*; +import com.jogamp.nativewindow.impl.NullWindow; public class WindowsDummyWGLDrawable extends WindowsWGLDrawable { private long hwnd, hdc; - public WindowsDummyWGLDrawable(GLDrawableFactory factory) { - super(factory, new NullWindow(WindowsWGLGraphicsConfigurationFactory.createDefaultGraphicsConfiguration(null, true, true)), true); + public WindowsDummyWGLDrawable(GLDrawableFactory factory, GLProfile glp) { + super(factory, new NullWindow(WindowsWGLGraphicsConfigurationFactory.createDefaultGraphicsConfiguration(glp, null, true, true)), true); // All entries to CreateDummyWindow must synchronize on one object // to avoid accidentally registering the dummy window class twice synchronized (WindowsDummyWGLDrawable.class) { @@ -56,8 +56,9 @@ public class WindowsDummyWGLDrawable extends WindowsWGLDrawable { hdc = WGL.GetDC(hwnd); NullWindow nw = (NullWindow) getNativeWindow(); nw.setSurfaceHandle(hdc); + WindowsWGLGraphicsConfiguration config = (WindowsWGLGraphicsConfiguration)nw.getGraphicsConfiguration().getNativeGraphicsConfiguration(); // Choose a (hopefully hardware-accelerated) OpenGL pixel format for this device context - GLCapabilities caps = new GLCapabilities(null); + GLCapabilities caps = (GLCapabilities) config.getChosenCapabilities(); caps.setDepthBits(16); PIXELFORMATDESCRIPTOR pfd = WindowsWGLGraphicsConfiguration.GLCapabilities2PFD(caps); int pixelFormat = WGL.ChoosePixelFormat(hdc, pfd); diff --git a/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsExternalWGLContext.java b/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsExternalWGLContext.java index b433b6b38..e712d8568 100755 --- a/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsExternalWGLContext.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsExternalWGLContext.java @@ -37,14 +37,12 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.impl.windows.wgl; +package com.jogamp.opengl.impl.windows.wgl; -import java.nio.*; -import java.util.*; import javax.media.opengl.*; import javax.media.nativewindow.*; -import com.sun.opengl.impl.*; -import com.sun.nativewindow.impl.NullWindow; +import com.jogamp.opengl.impl.*; +import com.jogamp.nativewindow.impl.NullWindow; public class WindowsExternalWGLContext extends WindowsWGLContext { private boolean firstMakeCurrent = true; @@ -53,12 +51,12 @@ public class WindowsExternalWGLContext extends WindowsWGLContext { private WindowsExternalWGLContext(Drawable drawable, long hglrc, WindowsWGLGraphicsConfiguration cfg) { super(drawable, null); - this.hglrc = hglrc; + this.context = hglrc; if (DEBUG) { System.err.println(getThreadName() + ": !!! Created external OpenGL context " + toHexString(hglrc) + " for " + this); } GLContextShareSet.contextCreated(this); - setGLFunctionAvailability(false); + setGLFunctionAvailability(false, 0, 0, CTX_PROFILE_COMPAT|CTX_OPTION_ANY); cfg.updateCapabilitiesByWGL(this); getGLStateTracker().setEnabled(false); // external context usage can't track state in Java } diff --git a/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsExternalWGLDrawable.java b/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsExternalWGLDrawable.java index 9b87afc38..74db45932 100755 --- a/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsExternalWGLDrawable.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsExternalWGLDrawable.java @@ -37,12 +37,12 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.impl.windows.wgl; +package com.jogamp.opengl.impl.windows.wgl; import javax.media.nativewindow.*; import javax.media.opengl.*; -import com.sun.opengl.impl.*; -import com.sun.nativewindow.impl.NullWindow; +import com.jogamp.opengl.impl.*; +import com.jogamp.nativewindow.impl.NullWindow; public class WindowsExternalWGLDrawable extends WindowsWGLDrawable { diff --git a/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsOffscreenWGLContext.java b/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsOffscreenWGLContext.java index 9f0a5d2a6..25d93b50e 100644 --- a/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsOffscreenWGLContext.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsOffscreenWGLContext.java @@ -37,10 +37,10 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.impl.windows.wgl; +package com.jogamp.opengl.impl.windows.wgl; import javax.media.opengl.*; -import com.sun.opengl.impl.*; +import com.jogamp.opengl.impl.*; public class WindowsOffscreenWGLContext extends WindowsWGLContext { public WindowsOffscreenWGLContext(WindowsOffscreenWGLDrawable drawable, diff --git a/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsOffscreenWGLDrawable.java b/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsOffscreenWGLDrawable.java index cd0491867..bf466d455 100644 --- a/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsOffscreenWGLDrawable.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsOffscreenWGLDrawable.java @@ -37,12 +37,12 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.impl.windows.wgl; +package com.jogamp.opengl.impl.windows.wgl; import javax.media.opengl.*; import javax.media.nativewindow.*; -import com.sun.opengl.impl.*; -import com.sun.nativewindow.impl.NullWindow; +import com.jogamp.opengl.impl.*; +import com.jogamp.nativewindow.impl.NullWindow; public class WindowsOffscreenWGLDrawable extends WindowsWGLDrawable { private long origbitmap; @@ -99,7 +99,7 @@ public class WindowsOffscreenWGLDrawable extends WindowsWGLDrawable { } ((SurfaceChangeable)nw).setSurfaceHandle(hdc); - hbitmap = WGL.CreateDIBSection(hdc, info, WGL.DIB_RGB_COLORS, 0, 0, 0); + hbitmap = WGL.CreateDIBSection(hdc, info, WGL.DIB_RGB_COLORS, null, 0, 0); if (hbitmap == 0) { WGL.DeleteDC(hdc); hdc = 0; diff --git a/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsOnscreenWGLContext.java b/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsOnscreenWGLContext.java index 2261f7742..aeb13110e 100644 --- a/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsOnscreenWGLContext.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsOnscreenWGLContext.java @@ -37,13 +37,13 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.impl.windows.wgl; +package com.jogamp.opengl.impl.windows.wgl; import java.util.*; import javax.media.nativewindow.*; import javax.media.opengl.*; -import com.sun.opengl.impl.*; +import com.jogamp.opengl.impl.*; public class WindowsOnscreenWGLContext extends WindowsWGLContext { protected WindowsOnscreenWGLDrawable drawable; diff --git a/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsOnscreenWGLDrawable.java b/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsOnscreenWGLDrawable.java index 395ccf7d2..401b8c3c6 100644 --- a/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsOnscreenWGLDrawable.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsOnscreenWGLDrawable.java @@ -37,11 +37,11 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.impl.windows.wgl; +package com.jogamp.opengl.impl.windows.wgl; import javax.media.nativewindow.*; import javax.media.opengl.*; -import com.sun.opengl.impl.*; +import com.jogamp.opengl.impl.*; public class WindowsOnscreenWGLDrawable extends WindowsWGLDrawable { protected WindowsOnscreenWGLDrawable(GLDrawableFactory factory, NativeWindow component) { diff --git a/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsPbufferWGLContext.java b/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsPbufferWGLContext.java index 9c492e244..a9e02e11f 100644 --- a/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsPbufferWGLContext.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsPbufferWGLContext.java @@ -37,10 +37,10 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.impl.windows.wgl; +package com.jogamp.opengl.impl.windows.wgl; import javax.media.opengl.*; -import com.sun.opengl.impl.*; +import com.jogamp.opengl.impl.*; public class WindowsPbufferWGLContext extends WindowsWGLContext { private static final boolean DEBUG = Debug.debug("WindowsPbufferWGLContext"); @@ -101,7 +101,7 @@ public class WindowsPbufferWGLContext extends WindowsWGLContext { // Initialize render-to-texture support if requested GL gl = getGL(); rtt = capabilities.getPbufferRenderToTexture(); - rect = gl.isGL2() && capabilities.getPbufferRenderToTextureRectangle(); + rect = gl.isGL2GL3() && capabilities.getPbufferRenderToTextureRectangle(); if (rtt) { if (DEBUG) { diff --git a/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsPbufferWGLDrawable.java b/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsPbufferWGLDrawable.java index c324b1ce1..c7034e93b 100644 --- a/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsPbufferWGLDrawable.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsPbufferWGLDrawable.java @@ -37,11 +37,11 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.impl.windows.wgl; +package com.jogamp.opengl.impl.windows.wgl; import javax.media.opengl.*; import javax.media.nativewindow.*; -import com.sun.opengl.impl.*; +import com.jogamp.opengl.impl.*; public class WindowsPbufferWGLDrawable extends WindowsWGLDrawable { private long cachedParentHdc; diff --git a/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLContext.java b/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsWGLContext.java index 497e9f03b..0f1f9813f 100644 --- a/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLContext.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsWGLContext.java @@ -37,14 +37,14 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.impl.windows.wgl; +package com.jogamp.opengl.impl.windows.wgl; import java.nio.*; import java.util.*; import javax.media.opengl.*; import javax.media.nativewindow.*; -import com.sun.opengl.impl.*; -import com.sun.gluegen.runtime.ProcAddressTable; +import com.jogamp.opengl.impl.*; +import com.jogamp.gluegen.runtime.ProcAddressTable; public class WindowsWGLContext extends GLContextImpl { protected long hglrc; @@ -118,20 +118,77 @@ public class WindowsWGLContext extends GLContextImpl { return wglExtProcAddressTable; } - protected String mapToRealGLFunctionName(String glFunctionName) { - String lookup = (String) functionNameMap.get(glFunctionName); - if (lookup != null) { - return lookup; - } - return glFunctionName; + 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 String mapToRealGLExtensionName(String glExtensionName) { - String lookup = (String) extensionNameMap.get(glExtensionName); - if (lookup != null) { - return lookup; + protected long createContextARBImpl(long share, boolean direct, int ctp, int major, int minor) { + WindowsWGLDrawableFactory factory = (WindowsWGLDrawableFactory)drawable.getFactoryImpl(); + WGLExt wglExt; + if(null==factory.getSharedContext()) { + wglExt = getWGLExt(); + } else { + wglExt = ((WindowsWGLContext)factory.getSharedContext()).getWGLExt(); + } + + boolean ctBwdCompat = 0 != ( CTX_PROFILE_COMPAT & ctp ) ; + boolean ctFwdCompat = 0 != ( CTX_OPTION_FORWARD & ctp ) ; + boolean ctDebug = 0 != ( CTX_OPTION_DEBUG & ctp ) ; + + long _context=0; + + int attribs[] = { + /* 0 */ WGLExt.WGL_CONTEXT_MAJOR_VERSION_ARB, major, + /* 2 */ WGLExt.WGL_CONTEXT_MINOR_VERSION_ARB, minor, + /* 4 */ WGLExt.WGL_CONTEXT_LAYER_PLANE_ARB, WGLExt.WGL_CONTEXT_LAYER_PLANE_ARB, // default + /* 6 */ WGLExt.WGL_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[8+0] = WGLExt.WGL_CONTEXT_PROFILE_MASK_ARB; + if( ctBwdCompat ) { + attribs[8+1] = WGLExt.WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB; + } else { + attribs[8+1] = WGLExt.WGL_CONTEXT_CORE_PROFILE_BIT_ARB; + } + } + + if ( major >= 3 ) { + if( !ctBwdCompat && ctFwdCompat ) { + attribs[6+1] |= WGLExt.WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB; + } + if( ctDebug) { + attribs[6+1] |= WGLExt.WGL_CONTEXT_DEBUG_BIT_ARB; + } + } + + _context = wglExt.wglCreateContextAttribsARB(drawable.getNativeWindow().getSurfaceHandle(), share, attribs, 0); + if(0==_context) { + if(DEBUG) { + System.err.println("WindowsWGLContext.createContextARB couldn't create "+getGLVersion(null, major, minor, ctp, "@creation")); + } + } else { + // In contrast to GLX no verification with a drawable binding, ie default framebuffer, is necessary, + // if no 3.2 is available creation fails already! + // Nevertheless .. we do it .. + if (!WGL.wglMakeCurrent(drawable.getNativeWindow().getSurfaceHandle(), _context)) { + if(DEBUG) { + System.err.println("WindowsWGLContext.createContextARB couldn't make current "+getGLVersion(null, major, minor, ctp, "@creation")); + } + WGL.wglMakeCurrent(0, 0); + WGL.wglDeleteContext(_context); + _context = 0; + } } - return glExtensionName; + return _context; } /** @@ -139,39 +196,54 @@ public class WindowsWGLContext extends GLContextImpl { * called by {@link #makeCurrentImpl()}. */ protected void create() { - GLCapabilities glCaps = drawable.getChosenGLCapabilities(); - if(DEBUG) { - System.err.println("WindowsWGLContext.create got "+glCaps); + if(0!=context) { + throw new GLException("context is not null: "+context); } + WindowsWGLDrawableFactory factory = (WindowsWGLDrawableFactory)drawable.getFactoryImpl(); + GLCapabilities glCaps = drawable.getChosenGLCapabilities(); if (drawable.getNativeWindow().getSurfaceHandle() == 0) { throw new GLException("Internal error: attempted to create OpenGL context without an associated drawable"); } // Windows can set up sharing of display lists after creation time WindowsWGLContext other = (WindowsWGLContext) GLContextShareSet.getShareContext(this); - long hglrc2 = 0; + long share = 0; if (other != null) { - hglrc2 = other.getHGLRC(); - if (hglrc2 == 0) { + share = other.getHGLRC(); + if (share == 0) { throw new GLException("GLContextShareSet returned an invalid OpenGL context"); } } - // To use WGL_ARB_create_context, we have to make a temp context current, - // so we are able to use GetProcAddress - long temp_hglrc = WGL.wglCreateContext(drawable.getNativeWindow().getSurfaceHandle()); - if (DEBUG) { - System.err.println(getThreadName() + ": !!! Created temp OpenGL context " + toHexString(temp_hglrc) + " for " + this + ", device context " + toHexString(drawable.getNativeWindow().getSurfaceHandle()) + ", not yet sharing"); + 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!=factory.getSharedContext() && factory.getSharedContext().isCreatedWithARBMethod()) { + if(DEBUG) { + System.err.println("WindowsWGLContext.createContext using shared Context: "+factory.getSharedContext()); + } + hglrc = createContextARB(share, true, major, minor, ctp); + createContextARBTried = true; } - if (temp_hglrc == 0) { - throw new GLException("Unable to create temp OpenGL context for device context " + toHexString(drawable.getNativeWindow().getSurfaceHandle())); - } else { + + long temp_hglrc = 0; + if(0==hglrc) { + // To use WGL_ARB_create_context, we have to make a temp context current, + // so we are able to use GetProcAddress + temp_hglrc = WGL.wglCreateContext(drawable.getNativeWindow().getSurfaceHandle()); + if (temp_hglrc == 0) { + throw new GLException("Unable to create temp OpenGL context for device context " + toHexString(drawable.getNativeWindow().getSurfaceHandle())); + } if (!WGL.wglMakeCurrent(drawable.getNativeWindow().getSurfaceHandle(), temp_hglrc)) { throw new GLException("Error making temp context current: 0x" + Integer.toHexString(WGL.GetLastError())); } - setGLFunctionAvailability(true); + setGLFunctionAvailability(true, 0, 0, CTX_PROFILE_COMPAT|CTX_OPTION_ANY); - if( !isFunctionAvailable("wglCreateContextAttribsARB") || + if( createContextARBTried || + !isFunctionAvailable("wglCreateContextAttribsARB") || !isExtensionAvailable("WGL_ARB_create_context") ) { if(glCaps.getGLProfile().isGL3()) { WGL.wglMakeCurrent(0, 0); @@ -181,132 +253,66 @@ public class WindowsWGLContext extends GLContextImpl { // continue with temp context for GL < 3.0 hglrc = temp_hglrc; - if(DEBUG) { - System.err.println("WindowsWGLContext.create done (old ctx < 3.0 - no WGL_ARB_create_context) 0x"+Long.toHexString(hglrc)); - } - } else { - WGLExt wglExt = getWGLExt(); + return; + } + hglrc = createContextARB(share, true, major, minor, ctp); + createContextARBTried=true; + } + + if(0!=hglrc) { + share = 0; // mark as shared .. - // preset with default values - int attribs[] = { - /* 0 */ WGLExt.WGL_CONTEXT_MAJOR_VERSION_ARB, 3, - /* 2 */ WGLExt.WGL_CONTEXT_MINOR_VERSION_ARB, 0, - /* 4 */ WGLExt.WGL_CONTEXT_FLAGS_ARB, 0 /* WGLExt.WGL_CONTEXT_DEBUG_BIT_ARB */, - /* 6 */ 0, 0, - /* 8 */ 0 - }; + WGL.wglMakeCurrent(0, 0); + WGL.wglDeleteContext(temp_hglrc); - if(glCaps.getGLProfile().isGL3()) { - // Try >= 3.2 core first ! - // In contrast to GLX no verify with a None drawable binding (default framebuffer) is necessary, - // if no 3.2 is available creation fails already! - attribs[0+1] = 3; - attribs[2+1] = 2; - if(glCaps.getGLProfile().isGL3bc()) { - attribs[6+0] = WGLExt.WGL_CONTEXT_PROFILE_MASK_ARB; - attribs[6+1] = WGLExt.WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB; - } - /** - * don't stricten requirements any further, even compatible would be fine - * - } else { - attribs[6+0] = WGLExt.WGL_CONTEXT_PROFILE_MASK_ARB; - attribs[6+1] = WGLExt.WGL_CONTEXT_CORE_PROFILE_BIT_ARB; - } - */ - hglrc = wglExt.wglCreateContextAttribsARB(drawable.getNativeWindow().getSurfaceHandle(), hglrc2, attribs, 0); - if(0==hglrc) { - if(DEBUG) { - System.err.println("WindowsWGLContext.createContext couldn't create >= 3.2 core context - fallback"); - } - // Try >= 3.1 forward compatible - last resort for GL3 ! - attribs[0+1] = 3; - attribs[2+1] = 1; - if(!glCaps.getGLProfile().isGL3bc()) { - attribs[4+1] |= WGLExt.WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB; - } - attribs[6+0] = 0; - attribs[6+1] = 0; - } else if(DEBUG) { - System.err.println("WindowsWGLContext.createContext >= 3.2 available 0x"+Long.toHexString(hglrc)); - } - } - if(0==hglrc) { - // 3.1 or 3.0 .. - hglrc = wglExt.wglCreateContextAttribsARB(drawable.getNativeWindow().getSurfaceHandle(), hglrc2, attribs, 0); - if(DEBUG) { - if(0==hglrc) { - System.err.println("WindowsWGLContext.createContext couldn't create >= 3.0 context - fallback"); - } else { - System.err.println("WindowsWGLContext.createContext >= 3.0 available 0x"+Long.toHexString(hglrc)); - } - } - } + if (!wglMakeContextCurrent(drawable.getNativeWindow().getSurfaceHandle(), drawableRead.getNativeWindow().getSurfaceHandle(), hglrc)) { + throw new GLException("Cannot make previous verified context current: 0x" + Integer.toHexString(WGL.GetLastError())); + } + } else { + if(glCaps.getGLProfile().isGL3()) { + WGL.wglMakeCurrent(0, 0); + WGL.wglDeleteContext(temp_hglrc); + throw new GLException("WindowsWGLContext.createContext failed, but context > GL2 requested "+getGLVersion(null, major[0], minor[0], ctp[0], "@creation")+", "); + } + if(DEBUG) { + System.err.println("WindowsWGLContext.createContext failed, fall back to !ARB context "+getGLVersion(null, major[0], minor[0], ctp[0], "@creation")); + } - if(0==hglrc) { - if(glCaps.getGLProfile().isGL3()) { - WGL.wglMakeCurrent(0, 0); - WGL.wglDeleteContext(temp_hglrc); - throw new GLException("Unable to create OpenGL >= 3.1 context (have WGL_ARB_create_context)"); - } - - // continue with temp context for GL < 3.0 - hglrc = temp_hglrc; - if (!WGL.wglMakeCurrent(drawable.getNativeWindow().getSurfaceHandle(), hglrc)) { - throw new GLException("Error making old context current: 0x" + Integer.toHexString(WGL.GetLastError())); - } - updateGLProcAddressTable(); - if(DEBUG) { - System.err.println("WindowsWGLContext.create done (old ctx < 3.0 - no 3.0) 0x"+Long.toHexString(hglrc)); - } - } else { - hglrc2 = 0; // mark as shared .. - WGL.wglMakeCurrent(0, 0); - WGL.wglDeleteContext(temp_hglrc); - - if (!WGL.wglMakeCurrent(drawable.getNativeWindow().getSurfaceHandle(), hglrc)) { - throw new GLException("Error making new context current: 0x" + Integer.toHexString(WGL.GetLastError())); - } - updateGLProcAddressTable(); - if(DEBUG) { - System.err.println("WindowsWGLContext.create done (new ctx >= 3.0) 0x"+Long.toHexString(hglrc)); - } - } + // continue with temp context for GL < 3.0 + hglrc = temp_hglrc; + if (!wglMakeContextCurrent(drawable.getNativeWindow().getSurfaceHandle(), drawableRead.getNativeWindow().getSurfaceHandle(), hglrc)) { + WGL.wglMakeCurrent(0, 0); + WGL.wglDeleteContext(hglrc); + throw new GLException("Error making old context current: 0x" + Integer.toHexString(WGL.GetLastError())); } } - if(0!=hglrc2) { - if (!WGL.wglShareLists(hglrc2, hglrc)) { - throw new GLException("wglShareLists(" + toHexString(hglrc2) + + + if(0!=share) { + if (!WGL.wglShareLists(share, hglrc)) { + throw new GLException("wglShareLists(" + toHexString(share) + ", " + toHexString(hglrc) + ") failed: error code 0x" + Integer.toHexString(WGL.GetLastError())); } } GLContextShareSet.contextCreated(this); - WGL.wglMakeCurrent(0, 0); // release immediatly to gain from ARB/EXT wglMakeContextCurrent(draw, read, ctx)! - if (DEBUG) { - System.err.println(getThreadName() + ": !!! Created OpenGL context " + toHexString(hglrc) + " for " + this + ", device context " + toHexString(drawable.getNativeWindow().getSurfaceHandle()) + ", sharing with " + toHexString(hglrc2)); - } } protected int makeCurrentImpl() throws GLException { if (drawable.getNativeWindow().getSurfaceHandle() == 0) { - if (DEBUG) { - System.err.println("drawable not properly initialized"); - } - return CONTEXT_NOT_CURRENT; + throw new GLException("drawable not properly initialized: "+drawable); } boolean created = false; if (hglrc == 0) { create(); + created = true; if (DEBUG) { System.err.println(getThreadName() + ": !!! Created GL context for " + getClass().getName()); } - created = true; } if (WGL.wglGetCurrentContext() != hglrc) { if (!wglMakeContextCurrent(drawable.getNativeWindow().getSurfaceHandle(), drawableRead.getNativeWindow().getSurfaceHandle(), hglrc)) { - throw new GLException("Error making context current: 0x" + Integer.toHexString(WGL.GetLastError())); + throw new GLException("Error making context current: 0x" + Integer.toHexString(WGL.GetLastError()) + ", " + this); } else { if (DEBUG && VERBOSE) { System.err.println(getThreadName() + ": wglMakeCurrent(hdc " + toHexString(drawable.getNativeWindow().getSurfaceHandle()) + @@ -316,7 +322,7 @@ public class WindowsWGLContext extends GLContextImpl { } if (created) { - setGLFunctionAvailability(false); + setGLFunctionAvailability(false, -1, -1, CTX_PROFILE_COMPAT|CTX_OPTION_ANY); WindowsWGLGraphicsConfiguration config = (WindowsWGLGraphicsConfiguration)drawable.getNativeWindow().getGraphicsConfiguration().getNativeGraphicsConfiguration(); @@ -365,7 +371,7 @@ public class WindowsWGLContext extends GLContextImpl { } } - protected void updateGLProcAddressTable() { + protected void updateGLProcAddressTable(int major, int minor, int ctp) { if (DEBUG) { System.err.println(getThreadName() + ": !!! Initializing WGL extension address table for " + this); } @@ -381,7 +387,7 @@ public class WindowsWGLContext extends GLContextImpl { wglExtProcAddressTable = new WGLExtProcAddressTable(); } resetProcAddressTable(getWGLExtProcAddressTable()); - super.updateGLProcAddressTable(); + super.updateGLProcAddressTable(major, minor, ctp); } public String getPlatformExtensionsString() { diff --git a/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLDrawable.java b/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsWGLDrawable.java index 91604d18e..43c1ff5e0 100644 --- a/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLDrawable.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsWGLDrawable.java @@ -37,12 +37,12 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.impl.windows.wgl; +package com.jogamp.opengl.impl.windows.wgl; +import com.jogamp.common.os.DynamicLookupHelper; import javax.media.nativewindow.*; import javax.media.opengl.*; -import com.sun.opengl.impl.*; -import com.sun.gluegen.runtime.DynamicLookupHelper; +import com.jogamp.opengl.impl.*; public abstract class WindowsWGLDrawable extends GLDrawableImpl { private static final int MAX_SET_PIXEL_FORMAT_FAIL_COUNT = 5; @@ -83,14 +83,14 @@ public abstract class WindowsWGLDrawable extends GLDrawableImpl { protected void swapBuffersImpl() { boolean didLock = false; - try { - if ( !isSurfaceLocked() ) { - // Usually the surface shall be locked within [makeCurrent .. swap .. release] - if (lockSurface() == NativeWindow.LOCK_SURFACE_NOT_READY) { - return; - } - didLock = true; + if ( !isSurfaceLocked() ) { + // Usually the surface shall be locked within [makeCurrent .. swap .. release] + if (lockSurface() == NativeWindow.LOCK_SURFACE_NOT_READY) { + return; } + didLock = true; + } + try { long startTime = 0; if (PROFILING) { diff --git a/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLDrawableFactory.java b/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsWGLDrawableFactory.java index e37179191..a4bf89b81 100644 --- a/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLDrawableFactory.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsWGLDrawableFactory.java @@ -37,16 +37,18 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.impl.windows.wgl; +package com.jogamp.opengl.impl.windows.wgl; +import com.jogamp.common.os.DynamicLookupHelper; import java.nio.*; import java.util.*; import javax.media.nativewindow.*; +import javax.media.nativewindow.windows.*; import javax.media.opengl.*; -import com.sun.opengl.impl.*; -import com.sun.nativewindow.impl.NWReflection; -import com.sun.gluegen.runtime.DynamicLookupHelper; -import com.sun.nativewindow.impl.NullWindow; +import com.jogamp.common.JogampRuntimeException; +import com.jogamp.common.util.*; +import com.jogamp.opengl.impl.*; +import com.jogamp.nativewindow.impl.NullWindow; public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl implements DynamicLookupHelper { private static final boolean VERBOSE = Debug.verbose(); @@ -65,14 +67,59 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl implements // The act of constructing them causes them to be registered new WindowsWGLGraphicsConfigurationFactory(); try { - NWReflection.createInstance("com.sun.opengl.impl.windows.wgl.awt.WindowsAWTWGLGraphicsConfigurationFactory", + ReflectionUtil.createInstance("com.jogamp.opengl.impl.windows.wgl.awt.WindowsAWTWGLGraphicsConfigurationFactory", new Object[] {}); - } catch (Throwable t) { } + } catch (JogampRuntimeException jre) { /* n/a .. */ } loadOpenGL32Library(); + + sharedDrawable = new WindowsDummyWGLDrawable(this, null); + WindowsWGLContext ctx = (WindowsWGLContext) sharedDrawable.createContext(null); + ctx.makeCurrent(); + canCreateGLPbuffer = ctx.getGL().isExtensionAvailable("GL_ARB_pbuffer"); + ctx.release(); + sharedContext = ctx; + if(null==sharedContext) { + throw new GLException("Couldn't init shared resources"); + } + if (DEBUG) { + System.err.println("!!! SharedContext: "+sharedContext+", pbuffer supported "+canCreateGLPbuffer); + } + } + + WindowsDummyWGLDrawable sharedDrawable=null; + WindowsWGLContext sharedContext=null; + boolean canCreateGLPbuffer = false; + + protected final GLDrawableImpl getSharedDrawable() { + validate(); + return sharedDrawable; + } + + protected final GLContextImpl getSharedContext() { + validate(); + return sharedContext; + } + + public void shutdown() { + super.shutdown(); + if (DEBUG) { + System.err.println("!!! Shutdown Shared:"); + System.err.println("!!! CTX : "+sharedContext); + System.err.println("!!! Drawable: "+sharedDrawable); + Exception e = new Exception("Debug"); + e.printStackTrace(); + } + if(null!=sharedContext) { + sharedContext.destroy(); // implies release, if current + } + if(null!=sharedDrawable) { + sharedDrawable.destroy(); + } } public GLDrawableImpl createOnscreenDrawable(NativeWindow target) { + validate(); if (target == null) { throw new IllegalArgumentException("Null target"); } @@ -80,66 +127,42 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl implements } protected GLDrawableImpl createOffscreenDrawable(NativeWindow target) { + validate(); + if (target == null) { + throw new IllegalArgumentException("Null target"); + } return new WindowsOffscreenWGLDrawable(this, target); } - private boolean pbufferSupportInitialized = false; - private boolean canCreateGLPbuffer = false; - public boolean canCreateGLPbuffer() { - if (!pbufferSupportInitialized) { - final GLDrawableFactory factory = this; - Runnable r = new Runnable() { - public void run() { - WindowsDummyWGLDrawable dummyDrawable = new WindowsDummyWGLDrawable(factory); - GLContext dummyContext = dummyDrawable.createContext(null); - if (dummyContext != null) { - GLContext lastContext = GLContext.getCurrent(); - if (lastContext != null) { - lastContext.release(); - } - dummyContext.makeCurrent(); - GL dummyGL = dummyContext.getGL(); - canCreateGLPbuffer = dummyGL.isExtensionAvailable("GL_ARB_pbuffer"); - pbufferSupportInitialized = true; - dummyContext.release(); - dummyContext.destroy(); - dummyDrawable.destroy(); - if (lastContext != null) { - lastContext.makeCurrent(); - } - } - } - }; - maybeDoSingleThreadedWorkaround(r); - } - if (DEBUG) { - System.err.println("WindowsWGLDrawableFactory.canCreateGLPbuffer() = " + canCreateGLPbuffer); - } + public boolean canCreateGLPbuffer(AbstractGraphicsDevice device) { + validate(); return canCreateGLPbuffer; } protected GLDrawableImpl createGLPbufferDrawableImpl(final NativeWindow target) { + validate(); + if (target == null) { + throw new IllegalArgumentException("Null target"); + } final List returnList = new ArrayList(); final GLDrawableFactory factory = this; + final WindowsWGLContext _sharedContext = sharedContext; + final WindowsDummyWGLDrawable _sharedDrawable = sharedDrawable; Runnable r = new Runnable() { public void run() { - WindowsDummyWGLDrawable dummyDrawable = new WindowsDummyWGLDrawable(factory); - WindowsWGLContext dummyContext = (WindowsWGLContext) dummyDrawable.createContext(null); GLContext lastContext = GLContext.getCurrent(); if (lastContext != null) { lastContext.release(); } - dummyContext.makeCurrent(); - WGLExt dummyWGLExt = dummyContext.getWGLExt(); + _sharedContext.makeCurrent(); + WGLExt wglExt = _sharedContext.getWGLExt(); try { GLDrawableImpl pbufferDrawable = new WindowsPbufferWGLDrawable(factory, target, - dummyDrawable, - dummyWGLExt); + _sharedDrawable, + wglExt); returnList.add(pbufferDrawable); - dummyContext.release(); - dummyContext.destroy(); - dummyDrawable.destroy(); } finally { + _sharedContext.release(); if (lastContext != null) { lastContext.makeCurrent(); } @@ -151,6 +174,7 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl implements } protected NativeWindow createOffscreenWindow(GLCapabilities capabilities, GLCapabilitiesChooser chooser, int width, int height) { + validate(); AbstractGraphicsScreen screen = DefaultGraphicsScreen.createDefault(); NullWindow nw = new NullWindow(WindowsWGLGraphicsConfigurationFactory.chooseGraphicsConfigurationStatic( capabilities, chooser, screen) ); @@ -159,18 +183,22 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl implements } public GLContext createExternalGLContext() { + validate(); return WindowsExternalWGLContext.create(this, null); } - public boolean canCreateExternalGLDrawable() { + public boolean canCreateExternalGLDrawable(AbstractGraphicsDevice device) { + validate(); return true; } public GLDrawable createExternalGLDrawable() { + validate(); return WindowsExternalWGLDrawable.create(this, null); } public void loadOpenGL32Library() { + validate(); if (hopengl32 == 0) { hopengl32 = WGL.LoadLibraryA("OpenGL32"); if (DEBUG) { @@ -182,6 +210,7 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl implements } public void loadGLULibrary() { + validate(); if (hglu32 == 0) { hglu32 = WGL.LoadLibraryA("GLU32"); if (hglu32 == 0) { @@ -191,6 +220,7 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl implements } public long dynamicLookupFunction(String glFuncName) { + validate(); long res = WGL.wglGetProcAddress(glFuncName); if (res == 0) { // It may happen that a driver doesn't return the OpenGL32 core function pointer @@ -222,12 +252,14 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl implements return detail; } - public boolean canCreateContextOnJava2DSurface() { + public boolean canCreateContextOnJava2DSurface(AbstractGraphicsDevice device) { + validate(); return false; } public GLContext createContextOnJava2DSurface(Object graphics, GLContext shareWith) throws GLException { + validate(); throw new GLException("Unimplemented on this platform"); } diff --git a/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLGraphicsConfiguration.java b/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsWGLGraphicsConfiguration.java index d6ea21b15..aed4012a4 100644 --- a/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLGraphicsConfiguration.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsWGLGraphicsConfiguration.java @@ -30,17 +30,15 @@ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ -package com.sun.opengl.impl.windows.wgl; +package com.jogamp.opengl.impl.windows.wgl; -import java.util.*; import javax.media.nativewindow.*; import javax.media.opengl.*; -import com.sun.opengl.impl.*; -import com.sun.gluegen.runtime.NativeLibrary; +import com.jogamp.opengl.impl.*; 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.sun.opengl.impl.Debug.debug("GraphicsConfiguration"); + 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; @@ -414,14 +412,16 @@ public class WindowsWGLGraphicsConfiguration extends DefaultGraphicsConfiguratio if ( onscreen ) { res = ( 0 != (val & WINDOW_BIT) ) ; } else { - res = ( 0 != (val & BITMAP_BIT) ) || usePBuffer ; - } - if ( usePBuffer ) { - res = res && ( 0 != (val & PBUFFER_BIT) ) ; + if ( usePBuffer ) { + res = ( 0 != (val & PBUFFER_BIT) ) ; + } else { + res = ( 0 != (val & BITMAP_BIT) ) ; + } } return res; } + public static GLCapabilities AttribList2GLCapabilities(GLProfile glp, int[] iattribs, int niattribs, int[] iresults, @@ -435,7 +435,10 @@ public class WindowsWGLGraphicsConfiguration extends DefaultGraphicsConfiguratio res.setOnscreen( 0 != (drawableTypeBits & WINDOW_BIT) ); res.setPBuffer ( 0 != (drawableTypeBits & PBUFFER_BIT) ); } else { - throw new GLException("WGL DrawableType does not match !!!"); + 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++) { diff --git a/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java b/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java index 229042d9d..ab3227257 100644 --- a/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java @@ -30,14 +30,14 @@ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ -package com.sun.opengl.impl.windows.wgl; +package com.jogamp.opengl.impl.windows.wgl; import javax.media.nativewindow.*; import javax.media.nativewindow.windows.*; -import com.sun.nativewindow.impl.*; +import com.jogamp.nativewindow.impl.*; import javax.media.opengl.*; -import com.sun.opengl.impl.*; +import com.jogamp.opengl.impl.*; /** Subclass of GraphicsConfigurationFactory used when non-AWT tookits are used on Windows platforms. Toolkits will likely need to delegate @@ -45,7 +45,7 @@ import com.sun.opengl.impl.*; GraphicsDevice and GraphicsConfiguration abstractions. */ public class WindowsWGLGraphicsConfigurationFactory extends GraphicsConfigurationFactory { - protected static final boolean DEBUG = com.sun.opengl.impl.Debug.debug("GraphicsConfiguration"); + protected static final boolean DEBUG = com.jogamp.opengl.impl.Debug.debug("GraphicsConfiguration"); public WindowsWGLGraphicsConfigurationFactory() { GraphicsConfigurationFactory.registerFactory(javax.media.nativewindow.windows.WindowsGraphicsDevice.class, this); @@ -58,22 +58,17 @@ public class WindowsWGLGraphicsConfigurationFactory extends GraphicsConfiguratio return chooseGraphicsConfigurationStatic(caps, chooser, absScreen); } - protected static WindowsWGLGraphicsConfiguration createDefaultGraphicsConfiguration(AbstractGraphicsScreen absScreen, boolean onscreen, boolean usePBuffer) { - GLCapabilities caps = new GLCapabilities(null); - caps.setDoubleBuffered(onscreen); // FIXME + protected static WindowsWGLGraphicsConfiguration createDefaultGraphicsConfiguration(GLProfile glp, AbstractGraphicsScreen absScreen, boolean onscreen, boolean usePBuffer) { + GLCapabilities caps = new GLCapabilities(glp); + caps.setDoubleBuffered(onscreen); // FIXME DBLBUFOFFSCRN caps.setOnscreen (onscreen); caps.setPBuffer (usePBuffer); - GLCapabilities caps2 = (GLCapabilities) caps.clone(); - if(!caps2.isOnscreen()) { - // OFFSCREEN !DOUBLE_BUFFER - caps2.setDoubleBuffered(false); - } - if(null==absScreen) { absScreen = DefaultGraphicsScreen.createScreenDevice(0); } - return new WindowsWGLGraphicsConfiguration(absScreen, caps2, caps, WindowsWGLGraphicsConfiguration.GLCapabilities2PFD(caps2), -1, null); + return new WindowsWGLGraphicsConfiguration(absScreen, caps, caps, WindowsWGLGraphicsConfiguration.GLCapabilities2PFD(caps), -1, null); + } protected static WindowsWGLGraphicsConfiguration chooseGraphicsConfigurationStatic(GLCapabilities caps, @@ -84,7 +79,7 @@ public class WindowsWGLGraphicsConfigurationFactory extends GraphicsConfiguratio } GLCapabilities caps2 = (GLCapabilities) caps.clone(); if(!caps2.isOnscreen()) { - // OFFSCREEN !DOUBLE_BUFFER + // OFFSCREEN !DOUBLE_BUFFER // FIXME DBLBUFOFFSCRN caps2.setDoubleBuffered(false); } return new WindowsWGLGraphicsConfiguration(absScreen, caps2, caps, WindowsWGLGraphicsConfiguration.GLCapabilities2PFD(caps2), -1, @@ -92,7 +87,8 @@ public class WindowsWGLGraphicsConfigurationFactory extends GraphicsConfiguratio } protected static void updateGraphicsConfiguration(CapabilitiesChooser chooser, - GLDrawableFactory factory, NativeWindow nativeWindow) { + GLDrawableFactory _factory, NativeWindow nativeWindow) { + WindowsWGLDrawableFactory factory = (WindowsWGLDrawableFactory) _factory; if (nativeWindow == null) { throw new IllegalArgumentException("NativeWindow is null"); } @@ -139,25 +135,15 @@ public class WindowsWGLGraphicsConfigurationFactory extends GraphicsConfiguratio pfd = WindowsWGLGraphicsConfiguration.createPixelFormatDescriptor(); // Produce a recommended pixel format selection for the GLCapabilitiesChooser. // Use wglChoosePixelFormatARB if user requested multisampling and if we have it available - WindowsWGLDrawable dummyDrawable = null; - GLContextImpl dummyContext = null; - WGLExt dummyWGLExt = null; - if (capabilities.getSampleBuffers()) { - dummyDrawable = new WindowsDummyWGLDrawable(factory); - dummyContext = (GLContextImpl) dummyDrawable.createContext(null); - if (dummyContext != null) { - dummyContext.makeCurrent(); - dummyWGLExt = (WGLExt) dummyContext.getPlatformGLExtensions(); - } - } else if (DEBUG) { - System.err.println(getThreadName() + ": Not using WGL_ARB_pixel_format, because multisampling not requested"); - } + factory.sharedContext.makeCurrent(); + WGLExt wglExt = factory.sharedContext.getWGLExt(); + int recommendedPixelFormat = pixelFormat; // 1-based pixel format boolean haveWGLChoosePixelFormatARB = false; boolean gotAvailableCaps = false; - if (dummyWGLExt != null) { + if (wglExt != null) { try { - haveWGLChoosePixelFormatARB = dummyWGLExt.isExtensionAvailable("WGL_ARB_pixel_format"); + haveWGLChoosePixelFormatARB = wglExt.isExtensionAvailable("WGL_ARB_pixel_format"); if (haveWGLChoosePixelFormatARB) { if(pixelFormat<=0) { int[] iattributes = new int [2*WindowsWGLGraphicsConfiguration.MAX_ATTRIBS]; @@ -165,12 +151,12 @@ public class WindowsWGLGraphicsConfigurationFactory extends GraphicsConfiguratio if(WindowsWGLGraphicsConfiguration.GLCapabilities2AttribList(capabilities, iattributes, - dummyWGLExt, + wglExt, false, null)) { int[] pformats = new int[WindowsWGLGraphicsConfiguration.MAX_PFORMATS]; int[] numFormatsTmp = new int[1]; - if (dummyWGLExt.wglChoosePixelFormatARB(hdc, + if (wglExt.wglChoosePixelFormatARB(hdc, iattributes, 0, fattributes, 0, WindowsWGLGraphicsConfiguration.MAX_PFORMATS, @@ -201,16 +187,14 @@ public class WindowsWGLGraphicsConfigurationFactory extends GraphicsConfiguratio } } - availableCaps = WindowsWGLGraphicsConfiguration.HDC2GLCapabilities(dummyWGLExt, hdc, -1, glProfile, pixelFormatSet, onscreen, usePBuffer); + availableCaps = WindowsWGLGraphicsConfiguration.HDC2GLCapabilities(wglExt, hdc, -1, glProfile, pixelFormatSet, onscreen, usePBuffer); gotAvailableCaps = null!=availableCaps ; choosenBywGLPixelFormat = gotAvailableCaps ; } else if (DEBUG) { System.err.println(getThreadName() + ": wglChoosePixelFormatARB not available"); } } finally { - dummyContext.release(); - dummyContext.destroy(); - dummyDrawable.destroy(); + factory.sharedContext.release(); } } @@ -265,9 +249,11 @@ public class WindowsWGLGraphicsConfigurationFactory extends GraphicsConfiguratio } pixelFormat = 1; // default .. } else if ( pixelFormat > numFormats ) { - throw new GLException("Invalid result " + pixelFormat + - " from GLCapabilitiesChooser (should be between 1 and " + - numFormats + ")"); + // keep on going .. + if(DEBUG) { + System.err.println("GLCapabilitiesChooser specified invalid index (expected 1.." + numFormats + ", got "+pixelFormat+")"); + } + pixelFormat = 1; // default .. } } chosenCaps = availableCaps[pixelFormat-1]; diff --git a/src/jogl/classes/com/sun/opengl/impl/windows/wgl/awt/WindowsAWTWGLGraphicsConfigurationFactory.java b/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/awt/WindowsAWTWGLGraphicsConfigurationFactory.java index f4c0a8049..02cfd14c3 100644 --- a/src/jogl/classes/com/sun/opengl/impl/windows/wgl/awt/WindowsAWTWGLGraphicsConfigurationFactory.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/awt/WindowsAWTWGLGraphicsConfigurationFactory.java @@ -30,7 +30,7 @@ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ -package com.sun.opengl.impl.windows.wgl.awt; +package com.jogamp.opengl.impl.windows.wgl.awt; import java.awt.GraphicsConfiguration; import java.awt.GraphicsDevice; @@ -41,13 +41,13 @@ import javax.media.nativewindow.awt.*; import javax.media.opengl.*; import javax.media.opengl.awt.*; -import com.sun.opengl.impl.*; -import com.sun.opengl.impl.windows.wgl.*; -import com.sun.nativewindow.impl.jawt.*; -import com.sun.nativewindow.impl.jawt.windows.*; +import com.jogamp.opengl.impl.*; +import com.jogamp.opengl.impl.windows.wgl.*; +import com.jogamp.nativewindow.impl.jawt.*; +import com.jogamp.nativewindow.impl.jawt.windows.*; public class WindowsAWTWGLGraphicsConfigurationFactory extends GraphicsConfigurationFactory { - protected static final boolean DEBUG = com.sun.opengl.impl.Debug.debug("GraphicsConfiguration"); + protected static final boolean DEBUG = com.jogamp.opengl.impl.Debug.debug("GraphicsConfiguration"); public WindowsAWTWGLGraphicsConfigurationFactory() { GraphicsConfigurationFactory.registerFactory(javax.media.nativewindow.awt.AWTGraphicsDevice.class, this); diff --git a/src/jogl/classes/com/sun/opengl/impl/x11/glx/GLXUtil.java b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/GLXUtil.java index 418d31503..ec0eaf94f 100644 --- a/src/jogl/classes/com/sun/opengl/impl/x11/glx/GLXUtil.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/GLXUtil.java @@ -30,18 +30,16 @@ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ -package com.sun.opengl.impl.x11.glx; +package com.jogamp.opengl.impl.x11.glx; import javax.media.opengl.*; -import com.sun.opengl.impl.*; -import javax.media.nativewindow.NativeWindowFactory; -import com.sun.nativewindow.impl.x11.*; +import com.jogamp.nativewindow.impl.x11.*; public class GLXUtil { public static boolean isMultisampleAvailable(long display) { + X11Lib.XLockDisplay(display); try { - X11Lib.XLockDisplay(display); String exts = GLX.glXGetClientString(display, GLX.GLX_EXTENSIONS); if (exts != null) { return (exts.indexOf("GLX_ARB_multisample") >= 0); @@ -54,13 +52,55 @@ public class GLXUtil { /** Workaround for apparent issue with ATI's proprietary drivers where direct contexts still send GLX tokens for GL calls */ - public static boolean isVendorATI(long display) { + public static String getVendorName(long display) { + X11Lib.XLockDisplay(display); try { - X11Lib.XLockDisplay(display); - String vendor = GLX.glXGetClientString(display, GLX.GLX_VENDOR); - return vendor != null && vendor.startsWith("ATI") ; + return GLX.glXGetClientString(display, GLX.GLX_VENDOR); } finally { X11Lib.XUnlockDisplay(display); } } + + 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 new file mode 100644 index 000000000..1f148bead --- /dev/null +++ b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11DummyGLXDrawable.java @@ -0,0 +1,94 @@ +/* + * Copyright (c) 2010 Sven Gothel. All Rights Reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * - Redistribution of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistribution in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * Neither the name Sven Gothel or the names of + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * This software is provided "AS IS," without a warranty of any kind. ALL + * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, + * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN + * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR + * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR + * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR + * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR + * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE + * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, + * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF + * SVEN GOTHEL HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + */ + +package com.jogamp.opengl.impl.x11.glx; + +import javax.media.opengl.*; +import com.jogamp.opengl.impl.*; + +import javax.media.nativewindow.*; +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, GLProfile glp) { + super(factory, + new NullWindow(X11GLXGraphicsConfigurationFactory.chooseGraphicsConfigurationStatic( + new GLCapabilities(glp), null, screen))); + this.realized = true; + + NullWindow nw = (NullWindow) getNativeWindow(); + X11GLXGraphicsConfiguration config = (X11GLXGraphicsConfiguration)nw.getGraphicsConfiguration().getNativeGraphicsConfiguration(); + GLCapabilities caps = (GLCapabilities) config.getChosenCapabilities(); + + X11GraphicsDevice device = (X11GraphicsDevice) screen.getDevice(); + long dpy = device.getHandle(); + int scrn = screen.getIndex(); + long visualID = config.getVisualID(); + + X11Lib.XLockDisplay(dpy); + try{ + dummyWindow = X11Lib.CreateDummyWindow(dpy, scrn, visualID); + } finally { + X11Lib.XUnlockDisplay(dpy); + } + nw.setSurfaceHandle( dummyWindow ); + } + + public void setSize(int width, int height) { + } + + public int getWidth() { + return 1; + } + + public int getHeight() { + return 1; + } + + public void destroy() { + if(0!=dummyWindow) { + X11GLXGraphicsConfiguration config = (X11GLXGraphicsConfiguration)getNativeWindow().getGraphicsConfiguration().getNativeGraphicsConfiguration(); + long dpy = config.getScreen().getDevice().getHandle(); + X11Lib.DestroyDummyWindow(dpy, dummyWindow); + } + } +} diff --git a/src/jogl/classes/com/sun/opengl/impl/x11/glx/X11ExternalGLXContext.java b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11ExternalGLXContext.java index 7e3755870..139c0deed 100755 --- a/src/jogl/classes/com/sun/opengl/impl/x11/glx/X11ExternalGLXContext.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11ExternalGLXContext.java @@ -37,14 +37,14 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.impl.x11.glx; +package com.jogamp.opengl.impl.x11.glx; import javax.media.nativewindow.*; import javax.media.nativewindow.x11.*; import javax.media.opengl.*; -import com.sun.opengl.impl.*; -import com.sun.nativewindow.impl.NullWindow; -import com.sun.nativewindow.impl.x11.*; +import com.jogamp.opengl.impl.*; +import com.jogamp.nativewindow.impl.NullWindow; +import com.jogamp.nativewindow.impl.x11.*; public class X11ExternalGLXContext extends X11GLXContext { private boolean firstMakeCurrent = true; @@ -55,7 +55,7 @@ public class X11ExternalGLXContext extends X11GLXContext { super(drawable, null); this.context = context; GLContextShareSet.contextCreated(this); - setGLFunctionAvailability(false); + setGLFunctionAvailability(false, 0, 0, CTX_PROFILE_COMPAT|CTX_OPTION_ANY); getGLStateTracker().setEnabled(false); // external context usage can't track state in Java } diff --git a/src/jogl/classes/com/sun/opengl/impl/x11/glx/X11ExternalGLXDrawable.java b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11ExternalGLXDrawable.java index 75a6b221a..f10bd38c6 100755 --- a/src/jogl/classes/com/sun/opengl/impl/x11/glx/X11ExternalGLXDrawable.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11ExternalGLXDrawable.java @@ -37,16 +37,14 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.impl.x11.glx; +package com.jogamp.opengl.impl.x11.glx; import javax.media.nativewindow.*; import javax.media.nativewindow.x11.*; import javax.media.opengl.*; -import com.sun.opengl.impl.*; -import com.sun.nativewindow.impl.NullWindow; -import com.sun.nativewindow.impl.x11.*; +import com.jogamp.opengl.impl.*; +import com.jogamp.nativewindow.impl.NullWindow; -import com.sun.gluegen.runtime.PointerBuffer; public class X11ExternalGLXDrawable extends X11GLXDrawable { private int fbConfigID; diff --git a/src/jogl/classes/com/sun/opengl/impl/x11/glx/X11GLXContext.java b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLXContext.java index 330d0a473..dce25978c 100644 --- a/src/jogl/classes/com/sun/opengl/impl/x11/glx/X11GLXContext.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLXContext.java @@ -37,23 +37,24 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.impl.x11.glx; +package com.jogamp.opengl.impl.x11.glx; import java.nio.*; import java.util.*; import javax.media.opengl.*; import javax.media.nativewindow.*; import javax.media.nativewindow.x11.*; -import com.sun.opengl.impl.*; -import com.sun.opengl.impl.x11.glx.*; -import com.sun.nativewindow.impl.x11.*; -import com.sun.gluegen.runtime.ProcAddressTable; +import com.jogamp.opengl.impl.*; +import com.jogamp.opengl.impl.x11.glx.*; +import com.jogamp.nativewindow.impl.x11.*; +import com.jogamp.gluegen.runtime.ProcAddressTable; public abstract class X11GLXContext extends GLContextImpl { protected long context; private boolean glXQueryExtensionsStringInitialized; private boolean glXQueryExtensionsStringAvailable; private static final Map/*<String, String>*/ functionNameMap; + private static final Map/*<String, String>*/ extensionNameMap; private GLXExt glXExt; // Table that holds the addresses of the native C-language entry points for // GLX extension functions. @@ -63,6 +64,10 @@ public abstract class X11GLXContext extends GLContextImpl { 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, @@ -94,35 +99,121 @@ public abstract class X11GLXContext extends GLContextImpl { return glXExt; } - protected String mapToRealGLFunctionName(String glFunctionName) { - String lookup = (String) functionNameMap.get(glFunctionName); - if (lookup != null) { - return lookup; + 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 { + res = GLX.glXMakeContextCurrent(dpy, writeDrawable, readDrawable, ctx); + } catch (RuntimeException re) { + if(DEBUG) { + System.err.println("X11GLXContext.glXMakeContextCurrent failed: "+re+", with "+ + "dpy "+toHexString(dpy)+ + ", write "+toHexString(writeDrawable)+ + ", read "+toHexString(readDrawable)+ + ", ctx "+toHexString(ctx)); + re.printStackTrace(); + } } - return glFunctionName; + return res; } - protected String mapToRealGLExtensionName(String glExtensionName) { - return glExtensionName; + protected void destroyContextARBImpl(long _context) { + X11GLXGraphicsConfiguration config = (X11GLXGraphicsConfiguration)drawable.getNativeWindow().getGraphicsConfiguration().getNativeGraphicsConfiguration(); + long display = config.getScreen().getDevice().getHandle(); + + glXMakeContextCurrent(display, 0, 0, 0); + GLX.glXDestroyContext(display, _context); } - /** Helper routine which usually just turns around and calls - * createContext (except for pbuffers, which use a different context - * creation mechanism). Should only be called by {@link - * makeCurrentImpl()}. - */ - protected abstract void create(); + protected long createContextARBImpl(long share, boolean direct, int ctp, int major, int minor) { + X11GLXDrawableFactory factory = (X11GLXDrawableFactory)drawable.getFactoryImpl(); + X11GLXGraphicsConfiguration config = (X11GLXGraphicsConfiguration)drawable.getNativeWindow().getGraphicsConfiguration().getNativeGraphicsConfiguration(); + long display = config.getScreen().getDevice().getHandle(); + + GLXExt glXExt; + if(null==factory.getSharedContext()) { + glXExt = getGLXExt(); + } else { + glXExt = ((X11GLXContext)factory.getSharedContext()).getGLXExt(); + } + + boolean ctBwdCompat = 0 != ( CTX_PROFILE_COMPAT & ctp ) ; + boolean ctFwdCompat = 0 != ( CTX_OPTION_FORWARD & ctp ) ; + boolean ctDebug = 0 != ( CTX_OPTION_DEBUG & ctp ) ; + + long _context=0; + + 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[8+0] = GLX.GLX_CONTEXT_PROFILE_MASK_ARB; + if( ctBwdCompat ) { + attribs[8+1] = GLX.GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB; + } else { + attribs[8+1] = GLX.GLX_CONTEXT_CORE_PROFILE_BIT_ARB; + } + } + + if ( major >= 3 ) { + if( !ctBwdCompat && ctFwdCompat ) { + attribs[6+1] |= GLX.GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB; + } + if( ctDebug) { + attribs[6+1] |= GLX.GLX_CONTEXT_DEBUG_BIT_ARB; + } + } + + try { + _context = glXExt.glXCreateContextAttribsARB(display, config.getFBConfig(), share, direct, attribs, 0); + } catch (RuntimeException re) { + if(DEBUG) { + System.err.println("X11GLXContext.createContextARB glXCreateContextAttribsARB failed: "+re+", with "+getGLVersion(null, major, minor, ctp, "@creation")); + re.printStackTrace(); + } + } + if(0==_context) { + if(DEBUG) { + System.err.println("X11GLXContext.createContextARB couldn't create "+getGLVersion(null, major, minor, ctp, "@creation")); + } + } else { + if (!glXMakeContextCurrent(display, + drawable.getNativeWindow().getSurfaceHandle(), + drawableRead.getNativeWindow().getSurfaceHandle(), + _context)) { + if(DEBUG) { + System.err.println("X11GLXContext.createContextARB couldn't make current "+getGLVersion(null, major, minor, ctp, "@creation")); + } + glXMakeContextCurrent(display, 0, 0, 0); + GLX.glXDestroyContext(display, _context); + _context = 0; + } + } + return _context; + } /** * Creates and initializes an appropriate OpenGL context. Should only be - * called by {@link create()}. + * called by {@link #create()}. * Note: The direct parameter may be overwritten by the direct state of a shared context. */ protected void createContext(boolean direct) { - X11GLXGraphicsConfiguration config = (X11GLXGraphicsConfiguration)drawable.getNativeWindow().getGraphicsConfiguration().getNativeGraphicsConfiguration(); - if(DEBUG) { - System.err.println("X11GLXContext.createContext got "+config); + if(0!=context) { + throw new GLException("context is not null: "+context); } + X11GLXDrawableFactory factory = (X11GLXDrawableFactory)drawable.getFactoryImpl(); + X11GLXGraphicsConfiguration config = (X11GLXGraphicsConfiguration)drawable.getNativeWindow().getGraphicsConfiguration().getNativeGraphicsConfiguration(); long display = config.getScreen().getDevice().getHandle(); X11GLXContext other = (X11GLXContext) GLContextShareSet.getShareContext(this); @@ -136,176 +227,107 @@ public abstract class X11GLXContext extends GLContextImpl { } GLCapabilities glCaps = (GLCapabilities) config.getChosenCapabilities(); - isVendorATI = GLXUtil.isVendorATI(display); + GLProfile glp = glCaps.getGLProfile(); + isVendorATI = factory.isVendorATI(); if(config.getFBConfigID()<0) { // not able to use FBConfig - if(glCaps.getGLProfile().isGL3()) { + if(glp.isGL3()) { throw new GLException("Unable to create OpenGL >= 3.1 context"); } context = GLX.glXCreateContext(display, config.getXVisualInfo(), share, direct); if (context == 0) { - throw new GLException("Unable to create OpenGL context"); + throw new GLException("Unable to create context(0)"); } - if (!GLX.glXMakeContextCurrent(display, - drawable.getNativeWindow().getSurfaceHandle(), - drawableRead.getNativeWindow().getSurfaceHandle(), - context)) { - throw new GLException("Error making temp context (old2) current: display 0x"+Long.toHexString(display)+", context 0x"+Long.toHexString(context)+", drawable "+drawable); + if (!glXMakeContextCurrent(display, + drawable.getNativeWindow().getSurfaceHandle(), + drawableRead.getNativeWindow().getSurfaceHandle(), + context)) { + throw new GLException("Error making temp context(0) current: display "+toHexString(display)+", context "+toHexString(context)+", drawable "+drawable); } - setGLFunctionAvailability(true); + setGLFunctionAvailability(true, 0, 0, CTX_PROFILE_COMPAT|CTX_OPTION_ANY); // use GL_VERSION + return; + } + + 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!=factory.getSharedContext() && factory.getSharedContext().isCreatedWithARBMethod()) { if(DEBUG) { - System.err.println("X11GLXContext.createContext done (old2 ctx) 0x"+Long.toHexString(context)); + System.err.println("X11GLXContext.createContext using shared Context: "+factory.getSharedContext()); } + context = createContextARB(share, direct, major, minor, ctp); + createContextARBTried = true; + } - } else { - + long temp_context = 0; + if(0==context) { // To use GLX_ARB_create_context, we have to make a temp context current, // so we are able to use GetProcAddress - long temp_context = GLX.glXCreateNewContext(display, config.getFBConfig(), GLX.GLX_RGBA_TYPE, share, direct); + temp_context = GLX.glXCreateNewContext(display, config.getFBConfig(), GLX.GLX_RGBA_TYPE, share, direct); if (temp_context == 0) { - throw new GLException("Unable to create temp OpenGL context"); - } else { - if (!GLX.glXMakeContextCurrent(display, - drawable.getNativeWindow().getSurfaceHandle(), - drawableRead.getNativeWindow().getSurfaceHandle(), - temp_context)) { - throw new GLException("Error making temp context (old) current: display 0x"+Long.toHexString(display)+", context 0x"+Long.toHexString(context)+", drawable "+drawable); + throw new GLException("Unable to create temp OpenGL context(1)"); + } + if (!glXMakeContextCurrent(display, + drawable.getNativeWindow().getSurfaceHandle(), + drawableRead.getNativeWindow().getSurfaceHandle(), + temp_context)) { + throw new GLException("Error making temp context(1) current: display "+toHexString(display)+", context "+toHexString(context)+", drawable "+drawable); + } + setGLFunctionAvailability(true, 0, 0, CTX_PROFILE_COMPAT|CTX_OPTION_ANY); // use GL_VERSION + + if( createContextARBTried || + !isFunctionAvailable("glXCreateContextAttribsARB") || + !isExtensionAvailable("GLX_ARB_create_context") ) { + if(glp.isGL3()) { + glXMakeContextCurrent(display, 0, 0, 0); + GLX.glXDestroyContext(display, temp_context); + throw new GLException("Unable to create OpenGL >= 3.1 context (failed GLX_ARB_create_context), GLProfile "+glp+", Drawable "+drawable); } - setGLFunctionAvailability(true); - - if( !isFunctionAvailable("glXCreateContextAttribsARB") || - !isExtensionAvailable("GLX_ARB_create_context") ) { - if(glCaps.getGLProfile().isGL3()) { - GLX.glXMakeContextCurrent(display, 0, 0, 0); - GLX.glXDestroyContext(display, temp_context); - throw new GLException("Unable to create OpenGL >= 3.1 context (no GLX_ARB_create_context)"); - } - - // continue with temp context for GL < 3.0 - context = temp_context; - if(DEBUG) { - System.err.println("X11GLXContext.createContext done (old ctx < 3.0 - no GLX_ARB_create_context) 0x"+Long.toHexString(context)); - } - } else { - GLXExt glXExt = getGLXExt(); - - // preset with default values - int attribs[] = { - /* 0 */ GLX.GLX_CONTEXT_MAJOR_VERSION_ARB, 3, - /* 2 */ GLX.GLX_CONTEXT_MINOR_VERSION_ARB, 0, - /* 4 */ GLX.GLX_RENDER_TYPE, GLX.GLX_RGBA_TYPE, - /* 6 */ GLX.GLX_CONTEXT_FLAGS_ARB, 0 /* GLX.GLX_CONTEXT_DEBUG_BIT_ARB */, - /* 8 */ 0, 0, - /* 10 */ 0 - }; - - if(glCaps.getGLProfile().isGL3()) { - // Try >= 3.2 core first - // and verify with a None drawable binding (default framebuffer) - attribs[0+1] = 3; - attribs[2+1] = 2; - if(glCaps.getGLProfile().isGL3bc()) { - attribs[8+0] = GLX.GLX_CONTEXT_PROFILE_MASK_ARB; - attribs[8+1] = GLX.GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB; - } - /** - * don't stricten requirements any further, even compatible would be fine - * - } else { - attribs[8+0] = GLX.GLX_CONTEXT_PROFILE_MASK_ARB; - attribs[8+1] = GLX.GLX_CONTEXT_CORE_PROFILE_BIT_ARB; - } - */ - - context = glXExt.glXCreateContextAttribsARB(display, config.getFBConfig(), share, direct, attribs, 0); - if(0!=context) { - if (!GLX.glXMakeContextCurrent(display, - drawable.getNativeWindow().getSurfaceHandle(), - drawableRead.getNativeWindow().getSurfaceHandle(), - context)) { - if(DEBUG) { - System.err.println("X11GLXContext.createContext couldn't make >= 3.2 core context current - fallback"); - } - GLX.glXMakeContextCurrent(display, 0, 0, 0); - GLX.glXDestroyContext(display, context); - context = 0; - } else if(DEBUG) { - System.err.println("X11GLXContext.createContext >= 3.2 available 0x"+Long.toHexString(context)); - } - } else { - if(DEBUG) { - System.err.println("X11GLXContext.createContext couldn't create >= 3.2 core context - fallback"); - } - } - if(0==context) { - // Try >= 3.1 forward compatible - last resort for GL3 ! - attribs[0+1] = 3; - attribs[2+1] = 1; - if(!glCaps.getGLProfile().isGL3bc()) { - attribs[6+1] |= GLX.GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB; - } - attribs[8+0] = 0; - attribs[8+1] = 0; - } - } - if(0==context) { - // 3.1 or 3.0 .. - context = glXExt.glXCreateContextAttribsARB(display, config.getFBConfig(), share, direct, attribs, 0); - if(0!=context) { - if (!GLX.glXMakeContextCurrent(display, - drawable.getNativeWindow().getSurfaceHandle(), - drawableRead.getNativeWindow().getSurfaceHandle(), - context)) { - if(DEBUG) { - System.err.println("X11GLXContext.createContext couldn't make >= 3.0 core context current - fallback"); - } - GLX.glXMakeContextCurrent(display, 0, 0, 0); - GLX.glXDestroyContext(display, context); - context = 0; - } else if(DEBUG) { - System.err.println("X11GLXContext.createContext >= 3.0 available 0x"+Long.toHexString(context)); - } - } else { - if(DEBUG) { - System.err.println("X11GLXContext.createContext couldn't create >= 3.0 core context - fallback"); - } - } - } - - if(0==context) { - if(glCaps.getGLProfile().isGL3()) { - GLX.glXMakeContextCurrent(display, 0, 0, 0); - GLX.glXDestroyContext(display, temp_context); - throw new GLException("Unable to create OpenGL >= 3.1 context (have GLX_ARB_create_context)"); - } - - // continue with temp context for GL < 3.0 - context = temp_context; - if (!GLX.glXMakeContextCurrent(display, - drawable.getNativeWindow().getSurfaceHandle(), - drawableRead.getNativeWindow().getSurfaceHandle(), - context)) { - GLX.glXMakeContextCurrent(display, 0, 0, 0); - GLX.glXDestroyContext(display, temp_context); - throw new GLException("Error making context (old) current: display 0x"+Long.toHexString(display)+", context 0x"+Long.toHexString(context)+", drawable "+drawable); - } - if(DEBUG) { - System.err.println("X11GLXContext.createContext done (old ctx < 3.0 - no 3.0) 0x"+Long.toHexString(context)); - } - } else { - GLX.glXDestroyContext(display, temp_context); - - // need to update the GL func table .. - updateGLProcAddressTable(); - if(DEBUG) { - System.err.println("X11GLXContext.createContext done (new ctx >= 3.0) 0x"+Long.toHexString(context)); - } - } + + // continue with temp context for GL < 3.0 + context = temp_context; + return; + } + context = createContextARB(share, direct, major, minor, ctp); + createContextARBTried=true; + } + + if(0!=context) { + if(0!=temp_context) { + glXMakeContextCurrent(display, 0, 0, 0); + GLX.glXDestroyContext(display, temp_context); + if (!glXMakeContextCurrent(display, + drawable.getNativeWindow().getSurfaceHandle(), + drawableRead.getNativeWindow().getSurfaceHandle(), + context)) { + throw new GLException("Cannot make previous verified context current"); } - } - } - GLContextShareSet.contextCreated(this); + } + } else { + if(glp.isGL3()) { + glXMakeContextCurrent(display, 0, 0, 0); + GLX.glXDestroyContext(display, temp_context); + throw new GLException("X11GLXContext.createContext failed, but context > GL2 requested "+getGLVersion(null, major[0], minor[0], ctp[0], "@creation")+", "); + } + if(DEBUG) { + System.err.println("X11GLXContext.createContext failed, fall back to !ARB context "+getGLVersion(null, major[0], minor[0], ctp[0], "@creation")); + } + + // continue with temp context for GL <= 3.0 + context = temp_context; + if (!glXMakeContextCurrent(display, + drawable.getNativeWindow().getSurfaceHandle(), + drawableRead.getNativeWindow().getSurfaceHandle(), + context)) { + glXMakeContextCurrent(display, 0, 0, 0); + GLX.glXDestroyContext(display, temp_context); + throw new GLException("Error making context(1) current: display "+toHexString(display)+", context "+toHexString(context)+", drawable "+drawable); + } + } } // Note: Usually the surface shall be locked within [makeCurrent .. swap .. release] @@ -340,34 +362,34 @@ public abstract class X11GLXContext extends GLContextImpl { } protected int makeCurrentImplAfterLock() throws GLException { + long dpy = drawable.getNativeWindow().getDisplayHandle(); + getDrawableImpl().getFactoryImpl().lockToolkit(); try { if (drawable.getNativeWindow().getSurfaceHandle() == 0) { - if (DEBUG) { - System.err.println("drawable not properly initialized"); - } - return CONTEXT_NOT_CURRENT; + throw new GLException("drawable not properly initialized: "+drawable); } boolean created = false; if (context == 0) { create(); + created = true; + GLContextShareSet.contextCreated(this); if (DEBUG) { System.err.println(getThreadName() + ": !!! Created GL context for " + getClass().getName()); } - created = true; } if (GLX.glXGetCurrentContext() != context) { - if (!GLX.glXMakeContextCurrent(drawable.getNativeWindow().getDisplayHandle(), - drawable.getNativeWindow().getSurfaceHandle(), - drawableRead.getNativeWindow().getSurfaceHandle(), - context)) { - throw new GLException("Error making context current"); + if (!glXMakeContextCurrent(dpy, + drawable.getNativeWindow().getSurfaceHandle(), + drawableRead.getNativeWindow().getSurfaceHandle(), + context)) { + throw new GLException("Error making context current: "+this); } if (DEBUG && (VERBOSE || created)) { System.err.println(getThreadName() + ": glXMakeCurrent(display " + - toHexString(drawable.getNativeWindow().getDisplayHandle()) + + toHexString(dpy)+ ", drawable " + toHexString(drawable.getNativeWindow().getSurfaceHandle()) + ", drawableRead " + toHexString(drawableRead.getNativeWindow().getSurfaceHandle()) + ", context " + toHexString(context) + ") succeeded"); @@ -375,7 +397,7 @@ public abstract class X11GLXContext extends GLContextImpl { } if (created) { - setGLFunctionAvailability(false); + setGLFunctionAvailability(false, -1, -1, CTX_PROFILE_COMPAT|CTX_OPTION_ANY); return CONTEXT_CURRENT_NEW; } return CONTEXT_CURRENT; @@ -387,7 +409,7 @@ public abstract class X11GLXContext extends GLContextImpl { protected void releaseImplAfterLock() throws GLException { getDrawableImpl().getFactoryImpl().lockToolkit(); try { - if (!GLX.glXMakeContextCurrent(drawable.getNativeWindow().getDisplayHandle(), 0, 0, 0)) { + if (!glXMakeContextCurrent(drawable.getNativeWindow().getDisplayHandle(), 0, 0, 0)) { throw new GLException("Error freeing OpenGL context"); } } finally { @@ -400,10 +422,10 @@ public abstract class X11GLXContext extends GLContextImpl { try { if (context != 0) { if (DEBUG) { - System.err.println("glXDestroyContext(0x" + - Long.toHexString(drawable.getNativeWindow().getDisplayHandle()) + - ", 0x" + - Long.toHexString(context) + ")"); + System.err.println("glXDestroyContext(" + + toHexString(drawable.getNativeWindow().getDisplayHandle()) + + ", " + + toHexString(context) + ")"); } GLX.glXDestroyContext(drawable.getNativeWindow().getDisplayHandle(), context); if (DEBUG) { @@ -442,7 +464,7 @@ public abstract class X11GLXContext extends GLContextImpl { } } - protected void updateGLProcAddressTable() { + protected void updateGLProcAddressTable(int major, int minor, int ctp) { if (DEBUG) { System.err.println(getThreadName() + ": !!! Initializing GLX extension address table"); } @@ -455,7 +477,7 @@ public abstract class X11GLXContext extends GLContextImpl { glXExtProcAddressTable = new GLXExtProcAddressTable(); } resetProcAddressTable(getGLXExtProcAddressTable()); - super.updateGLProcAddressTable(); + super.updateGLProcAddressTable(major, minor, ctp); } public synchronized String getPlatformExtensionsString() { @@ -485,7 +507,8 @@ public abstract class X11GLXContext extends GLContextImpl { public boolean isExtensionAvailable(String glExtensionName) { if (glExtensionName.equals("GL_ARB_pbuffer") || glExtensionName.equals("GL_ARB_pixel_format")) { - return getGLDrawable().getFactory().canCreateGLPbuffer(); + return getGLDrawable().getFactory().canCreateGLPbuffer( + drawable.getNativeWindow().getGraphicsConfiguration().getNativeGraphicsConfiguration().getScreen().getDevice() ); } return super.isExtensionAvailable(glExtensionName); } @@ -494,6 +517,10 @@ public abstract class X11GLXContext extends GLContextImpl { private int hasSwapIntervalSGI = 0; protected void setSwapIntervalImpl(int interval) { + X11GLXGraphicsConfiguration config = (X11GLXGraphicsConfiguration)drawable.getNativeWindow().getGraphicsConfiguration().getNativeGraphicsConfiguration(); + GLCapabilities glCaps = (GLCapabilities) config.getChosenCapabilities(); + if(!glCaps.isOnscreen()) return; + getDrawableImpl().getFactoryImpl().lockToolkit(); try { GLXExt glXExt = getGLXExt(); diff --git a/src/jogl/classes/com/sun/opengl/impl/x11/glx/X11GLXDrawable.java b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLXDrawable.java index c2a1987cc..95dfc0a1c 100644 --- a/src/jogl/classes/com/sun/opengl/impl/x11/glx/X11GLXDrawable.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLXDrawable.java @@ -37,13 +37,12 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.impl.x11.glx; +package com.jogamp.opengl.impl.x11.glx; import javax.media.nativewindow.*; import javax.media.opengl.*; -import com.sun.opengl.impl.*; -import com.sun.nativewindow.impl.x11.*; -import com.sun.gluegen.runtime.DynamicLookupHelper; +import com.jogamp.opengl.impl.*; +import com.jogamp.common.os.DynamicLookupHelper; public abstract class X11GLXDrawable extends GLDrawableImpl { protected X11GLXDrawable(GLDrawableFactory factory, NativeWindow comp, boolean realized) { @@ -74,25 +73,23 @@ public abstract class X11GLXDrawable extends GLDrawableImpl { } } - protected void swapBuffersImpl() { - boolean didLock = false; - try { - if ( !isSurfaceLocked() ) { - // Usually the surface shall be locked within [makeCurrent .. swap .. release] - if (lockSurface() == NativeWindow.LOCK_SURFACE_NOT_READY) { - return; - } - didLock=true; - } - - GLX.glXSwapBuffers(component.getDisplayHandle(), component.getSurfaceHandle()); - - } finally { - if(didLock) { - unlockSurface(); - } + protected void swapBuffersImpl() { + boolean didLock = false; + if (!isSurfaceLocked()) { + // Usually the surface shall be locked within [makeCurrent .. swap .. release] + if (lockSurface() == NativeWindow.LOCK_SURFACE_NOT_READY) { + return; + } + didLock = true; + } + try { + GLX.glXSwapBuffers(component.getDisplayHandle(), component.getSurfaceHandle()); + } finally { + if (didLock) { + unlockSurface(); + } + } } - } //--------------------------------------------------------------------------- // Internals only below this point diff --git a/src/jogl/classes/com/sun/opengl/impl/x11/glx/X11GLXDrawableFactory.java b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLXDrawableFactory.java index 09bea723f..d8e5f7646 100644 --- a/src/jogl/classes/com/sun/opengl/impl/x11/glx/X11GLXDrawableFactory.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLXDrawableFactory.java @@ -34,23 +34,22 @@ * facility. */ -package com.sun.opengl.impl.x11.glx; +package com.jogamp.opengl.impl.x11.glx; +import com.jogamp.common.os.DynamicLookupHelper; import java.nio.*; -import java.security.*; -import java.util.*; import javax.media.nativewindow.*; import javax.media.nativewindow.x11.*; import javax.media.opengl.*; -import com.sun.gluegen.runtime.*; -import com.sun.gluegen.runtime.opengl.*; -import com.sun.opengl.impl.*; -import com.sun.opengl.impl.x11.glx.*; -import com.sun.nativewindow.impl.NullWindow; -import com.sun.nativewindow.impl.NWReflection; -import com.sun.nativewindow.impl.x11.*; +import com.jogamp.gluegen.runtime.opengl.*; +import com.jogamp.opengl.impl.*; +import com.jogamp.common.JogampRuntimeException; +import com.jogamp.common.util.*; +import com.jogamp.nativewindow.impl.NullWindow; +import com.jogamp.nativewindow.impl.x11.*; public class X11GLXDrawableFactory extends GLDrawableFactoryImpl implements DynamicLookupHelper { + public X11GLXDrawableFactory() { super(); // Must initialize GLX support eagerly in case a pbuffer is the @@ -60,94 +59,206 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl implements Dyna // The act of constructing them causes them to be registered new X11GLXGraphicsConfigurationFactory(); try { - NWReflection.createInstance("com.sun.opengl.impl.x11.glx.awt.X11AWTGLXGraphicsConfigurationFactory", + ReflectionUtil.createInstance("com.jogamp.opengl.impl.x11.glx.awt.X11AWTGLXGraphicsConfigurationFactory", new Object[] {}); - } catch (Throwable t) { } + } catch (JogampRuntimeException jre) { /* n/a .. */ } + + X11GraphicsDevice sharedDevice = new X11GraphicsDevice(X11Util.createThreadLocalDisplay(null)); + vendorName = GLXUtil.getVendorName(sharedDevice.getHandle()); + isVendorATI = GLXUtil.isVendorATI(vendorName); + isVendorNVIDIA = GLXUtil.isVendorNVIDIA(vendorName); + if( isVendorATI() ) { + X11Util.markGlobalDisplayUndeletable(sharedDevice.getHandle()); // ATI hack .. + } + sharedScreen = new X11GraphicsScreen(sharedDevice, 0); + X11Lib.XLockDisplay(sharedScreen.getDevice().getHandle()); + try{ + sharedDrawable = new X11DummyGLXDrawable(sharedScreen, this, null); + X11GLXContext ctx = (X11GLXContext) sharedDrawable.createContext(null); + ctx.makeCurrent(); + ctx.release(); + sharedContext = ctx; + }finally{ + X11Lib.XUnlockDisplay(sharedScreen.getDevice().getHandle()); + } + if(null==sharedContext) { + throw new GLException("Couldn't init shared resources"); + } + if (DEBUG) { + System.err.println("!!! Vendor: "+vendorName+", ATI: "+isVendorATI+", NV: "+isVendorNVIDIA); + System.err.println("!!! SharedScreen: "+sharedScreen); + System.err.println("!!! SharedContext: "+sharedContext); + } + } + + private X11GraphicsScreen sharedScreen; + private String vendorName; + private boolean isVendorATI; + private boolean isVendorNVIDIA; + + public String getVendorName() { return vendorName; } + public boolean isVendorATI() { return isVendorATI; } + public boolean isVendorNVIDIA() { return isVendorNVIDIA; } + + private X11DummyGLXDrawable sharedDrawable=null; + private X11GLXContext sharedContext=null; + + protected final GLDrawableImpl getSharedDrawable() { + validate(); + return sharedDrawable; + } + + protected final GLContextImpl getSharedContext() { + validate(); + return sharedContext; + } + + public void shutdown() { + super.shutdown(); + if (DEBUG) { + System.err.println("!!! Shutdown Shared:"); + System.err.println("!!! CTX : "+sharedContext); + System.err.println("!!! Drawable: "+sharedDrawable); + System.err.println("!!! Screen : "+sharedScreen); + Exception e = new Exception("Debug"); + e.printStackTrace(); + } + if(null!=sharedContext) { + sharedContext.destroy(); // implies release, if current + } + if(null!=sharedDrawable) { + sharedDrawable.destroy(); + } + if(null!=sharedScreen) { + X11GraphicsDevice sharedDevice = (X11GraphicsDevice) sharedScreen.getDevice(); + if(null!=sharedDevice) { + X11Util.closeThreadLocalDisplay(null); + } + sharedScreen = null; + } + X11Util.shutdown( !isVendorATI(), DEBUG ); } public GLDrawableImpl createOnscreenDrawable(NativeWindow target) { + validate(); if (target == null) { throw new IllegalArgumentException("Null target"); } + if( isVendorATI() ) { + X11Util.markGlobalDisplayUndeletable(target.getDisplayHandle()); // ATI hack .. + } return new X11OnscreenGLXDrawable(this, target); } protected GLDrawableImpl createOffscreenDrawable(NativeWindow target) { + validate(); + if (target == null) { + throw new IllegalArgumentException("Null target"); + } + if( isVendorATI() ) { + X11Util.markGlobalDisplayUndeletable(target.getDisplayHandle()); // ATI hack .. + } return new X11OffscreenGLXDrawable(this, target); } - private boolean pbufferSupportInitialized = false; - private boolean canCreateGLPbuffer = false; - public boolean canCreateGLPbuffer() { - if (!pbufferSupportInitialized) { - long display = X11Util.getThreadLocalDefaultDisplay(); + public boolean canCreateGLPbuffer(AbstractGraphicsDevice device) { + validate(); + return glxVersionGreaterEqualThan(device, 1, 3); + } + + private boolean glxVersionsQueried = false; + private int glxVersionMajor=0, glxVersionMinor=0; + public boolean glxVersionGreaterEqualThan(AbstractGraphicsDevice device, int majorReq, int minorReq) { + validate(); + if (!glxVersionsQueried) { + if(null == device) { + device = (X11GraphicsDevice) sharedScreen.getDevice(); + } + if(null == device) { + throw new GLException("FIXME: No AbstractGraphicsDevice (passed or shared-device"); + } + long display = device.getHandle(); int[] major = new int[1]; int[] minor = new int[1]; - int screen = 0; // FIXME: provide way to specify this? - if (!GLX.glXQueryVersion(display, major, 0, minor, 0)) { - throw new GLException("glXQueryVersion failed"); - } + GLXUtil.getGLXVersion(display, major, minor); if (DEBUG) { System.err.println("!!! GLX version: major " + major[0] + ", minor " + minor[0]); } - // 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); - if (str != null && str.startsWith("1.") && - (str.charAt(2) >= '3')) { - canCreateGLPbuffer = true; - } - } else { - canCreateGLPbuffer = ((major[0] > 1) || (minor[0] > 2)); - } - - pbufferSupportInitialized = true; + glxVersionMajor = major[0]; + glxVersionMinor = minor[0]; + glxVersionsQueried = true; } - return canCreateGLPbuffer; + return ( glxVersionMajor > majorReq ) || ( glxVersionMajor == majorReq && glxVersionMinor >= minorReq ) ; } protected GLDrawableImpl createGLPbufferDrawableImpl(final NativeWindow target) { + validate(); + if (target == null) { + throw new IllegalArgumentException("Null target"); + } + + GLDrawableImpl pbufferDrawable; + /** - * 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 X11PbufferGLXDrawable(factory, target)); + * 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. + */ + boolean usedSharedContext=false; + if( isVendorATI() && null == GLContext.getCurrent() ) { + sharedContext.makeCurrent(); + usedSharedContext=true; + } + if( isVendorATI() ) { + X11Util.markGlobalDisplayUndeletable(target.getDisplayHandle()); // ATI hack .. + } + try { + pbufferDrawable = new X11PbufferGLXDrawable(this, target); + } finally { + if(usedSharedContext) { + sharedContext.release(); } - }; - maybeDoSingleThreadedWorkaround(r); - return (GLDrawableImpl) returnList.get(0); - */ - return new X11PbufferGLXDrawable(this, target); + } + return pbufferDrawable; } protected NativeWindow createOffscreenWindow(GLCapabilities capabilities, GLCapabilitiesChooser chooser, int width, int height) { - AbstractGraphicsScreen screen = X11GraphicsScreen.createDefault(); - NullWindow nw = new NullWindow(X11GLXGraphicsConfigurationFactory.chooseGraphicsConfigurationStatic(capabilities, chooser, screen)); - nw.setSize(width, height); + validate(); + NullWindow nw = null; + X11Lib.XLockDisplay(sharedScreen.getDevice().getHandle()); + try{ + nw = new NullWindow(X11GLXGraphicsConfigurationFactory.chooseGraphicsConfigurationStatic(capabilities, chooser, sharedScreen)); + }finally{ + X11Lib.XUnlockDisplay(sharedScreen.getDevice().getHandle()); + } + if(nw != null) { + nw.setSize(width, height); + } return nw; } public GLContext createExternalGLContext() { + validate(); return X11ExternalGLXContext.create(this, null); } - public boolean canCreateExternalGLDrawable() { - return canCreateGLPbuffer(); + public boolean canCreateExternalGLDrawable(AbstractGraphicsDevice device) { + validate(); + return canCreateGLPbuffer(device); } public GLDrawable createExternalGLDrawable() { + validate(); return X11ExternalGLXDrawable.create(this, null); } public void loadGLULibrary() { + validate(); X11Lib.dlopen("/usr/lib/libGLU.so"); } @@ -161,7 +272,8 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl implements Dyna return res; } - public boolean canCreateContextOnJava2DSurface() { + public boolean canCreateContextOnJava2DSurface(AbstractGraphicsDevice device) { + validate(); return false; } @@ -181,9 +293,10 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl implements Dyna return gammaRampLength; } - long display = X11Util.getThreadLocalDefaultDisplay(); + long display = sharedScreen.getDevice().getHandle(); + + X11Lib.XLockDisplay(display); try { - X11Lib.XLockDisplay(display); int[] size = new int[1]; boolean res = X11Lib.XF86VidModeGetGammaRampSize(display, X11Lib.DefaultScreen(display), @@ -206,9 +319,9 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl implements Dyna rampData[i] = (short) (ramp[i] * 65535); } - long display = X11Util.getThreadLocalDefaultDisplay(); + long display = sharedScreen.getDevice().getHandle(); + X11Lib.XLockDisplay(display); try { - X11Lib.XLockDisplay(display); boolean res = X11Lib.XF86VidModeSetGammaRamp(display, X11Lib.DefaultScreen(display), rampData.length, @@ -233,9 +346,9 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl implements Dyna rampData.position(2 * size); rampData.limit(3 * size); ShortBuffer blueRampData = rampData.slice(); - long display = X11Util.getThreadLocalDefaultDisplay(); + long display = sharedScreen.getDevice().getHandle(); + X11Lib.XLockDisplay(display); try { - X11Lib.XLockDisplay(display); boolean res = X11Lib.XF86VidModeGetGammaRamp(display, X11Lib.DefaultScreen(display), size, @@ -269,9 +382,9 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl implements Dyna rampData.position(2 * size); rampData.limit(3 * size); ShortBuffer blueRampData = rampData.slice(); - long display = X11Util.getThreadLocalDefaultDisplay(); + long display = sharedScreen.getDevice().getHandle(); + X11Lib.XLockDisplay(display); try { - X11Lib.XLockDisplay(display); X11Lib.XF86VidModeSetGammaRamp(display, X11Lib.DefaultScreen(display), size, diff --git a/src/jogl/classes/com/sun/opengl/impl/x11/glx/X11GLXGraphicsConfiguration.java b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLXGraphicsConfiguration.java index e1dca3af0..35daf0ae0 100644 --- a/src/jogl/classes/com/sun/opengl/impl/x11/glx/X11GLXGraphicsConfiguration.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLXGraphicsConfiguration.java @@ -30,16 +30,14 @@ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ -package com.sun.opengl.impl.x11.glx; +package com.jogamp.opengl.impl.x11.glx; -import java.util.*; +import com.jogamp.common.nio.PointerBuffer; import javax.media.nativewindow.*; import javax.media.nativewindow.x11.*; import javax.media.opengl.*; -import com.sun.opengl.impl.*; -import com.sun.gluegen.runtime.NativeLibrary; -import com.sun.gluegen.runtime.PointerBuffer; -import com.sun.nativewindow.impl.x11.*; +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"); @@ -66,18 +64,18 @@ public class X11GLXGraphicsConfiguration extends X11GraphicsConfiguration implem int screen = x11Screen.getIndex(); long fbcfg = glXFBConfigID2FBConfig(display, screen, fbcfgID); if(0==fbcfg) { - throw new GLException("FBConfig null of 0x"+Integer.toHexString(fbcfgID)); + throw new GLException("FBConfig null of "+toHexString(fbcfgID)); } if(null==glp) { glp = GLProfile.getDefault(); } GLCapabilities caps = GLXFBConfig2GLCapabilities(glp, display, fbcfg, true, true, true, GLXUtil.isMultisampleAvailable(display)); if(null==caps) { - throw new GLException("GLCapabilities null of 0x"+Long.toHexString(fbcfg)); + throw new GLException("GLCapabilities null of "+toHexString(fbcfg)); } XVisualInfo xvi = GLX.glXGetVisualFromFBConfigCopied(display, fbcfg); if(null==xvi) { - throw new GLException("XVisualInfo null of 0x"+Long.toHexString(fbcfg)); + throw new GLException("XVisualInfo null of "+toHexString(fbcfg)); } return new X11GLXGraphicsConfiguration(x11Screen, caps, caps, new DefaultGLCapabilitiesChooser(), xvi, fbcfg, fbcfgID); } @@ -106,6 +104,10 @@ public class X11GLXGraphicsConfiguration extends X11GraphicsConfiguration implem } } + private static int nonZeroOrDontCare(int value) { + return value != 0 ? value : (int)GLX.GLX_DONT_CARE ; + } + public static int[] GLCapabilities2AttribList(GLCapabilities caps, boolean forFBAttr, boolean isMultisampleAvailable, @@ -224,10 +226,11 @@ public class X11GLXGraphicsConfiguration extends X11GraphicsConfiguration implem if ( onscreen ) { res = ( 0 != (val & GLX.GLX_WINDOW_BIT) ) ; } else { - res = ( 0 != (val & GLX.GLX_PIXMAP_BIT) ) || usePBuffer ; - } - if ( usePBuffer ) { - res = res && ( 0 != (val & GLX.GLX_PBUFFER_BIT) ) ; + if ( usePBuffer ) { + res = ( 0 != (val & GLX.GLX_PBUFFER_BIT) ) ; + } else { + res = ( 0 != (val & GLX.GLX_PIXMAP_BIT) ) ; + } } return res; @@ -239,7 +242,10 @@ public class X11GLXGraphicsConfiguration extends X11GraphicsConfiguration implem int val; val = glXGetFBConfig(display, fbcfg, GLX.GLX_RENDER_TYPE, tmp, 0); if (val != GLX.GLX_RGBA_BIT) { - throw new GLException("Visual does not support RGBA"); + if(DEBUG) { + System.err.println("FBConfig ("+toHexString(fbcfg)+") does not support RGBA: "+toHexString(val)); + } + return null; } GLCapabilities res = new GLCapabilities(glp); @@ -251,7 +257,10 @@ public class X11GLXGraphicsConfiguration extends X11GraphicsConfiguration implem res.setOnscreen( 0 != (val & GLX.GLX_WINDOW_BIT) ); res.setPBuffer ( 0 != (val & GLX.GLX_PBUFFER_BIT) ); } else { - throw new GLException("GLX_DRAWABLE_TYPE does not match !!!"); + 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); @@ -304,7 +313,7 @@ public class X11GLXGraphicsConfiguration extends X11GraphicsConfiguration implem } int res = GLX.glXGetFBConfigAttrib(display, cfg, attrib, tmp, tmp_offset); if (res != 0) { - throw new GLException("glXGetFBConfig(0x"+Long.toHexString(attrib)+") failed: error code " + glXGetFBConfigErrorCode(res)); + throw new GLException("glXGetFBConfig("+toHexString(attrib)+") failed: error code " + glXGetFBConfigErrorCode(res)); } return tmp[tmp_offset]; } @@ -342,8 +351,8 @@ public class X11GLXGraphicsConfiguration extends X11GraphicsConfiguration implem NativeWindowFactory.getDefaultFactory().getToolkitLock().unlock(); } if (DEBUG) { - System.err.println("!!! Fetched XVisualInfo for visual ID 0x" + Long.toHexString(visualID)); - System.err.println("!!! Resulting XVisualInfo: visualid = 0x" + Long.toHexString(res.getVisualid())); + System.err.println("!!! Fetched XVisualInfo for visual ID " + toHexString(visualID)); + System.err.println("!!! Resulting XVisualInfo: visualid = " + toHexString(res.getVisualid())); } return res; } @@ -352,11 +361,17 @@ public class X11GLXGraphicsConfiguration extends X11GraphicsConfiguration implem int[] tmp = new int[1]; int val = glXGetConfig(display, info, GLX.GLX_USE_GL, tmp, 0); if (val == 0) { - throw new GLException("Visual does not support OpenGL"); + 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) { - throw new GLException("Visual does not support RGBA"); + if(DEBUG) { + System.err.println("Visual ("+toHexString(info.getVisualid())+") does not support RGBA"); + } + return null; } GLCapabilities res = new GLCapabilities(glp); res.setOnscreen (onscreen); @@ -401,13 +416,21 @@ public class X11GLXGraphicsConfiguration extends X11GraphicsConfiguration implem } int res = GLX.glXGetConfig(display, info, attrib, tmp, tmp_offset); if (res != 0) { - throw new GLException("glXGetConfig(0x"+Long.toHexString(attrib)+") failed: error code " + glXGetConfigErrorCode(res)); + 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 0x" + Long.toHexString(getVisualID()) + ", fbConfigID 0x" + Long.toHexString(fbConfigID) + + return "X11GLXGraphicsConfiguration["+getScreen()+", visualID " + toHexString(getVisualID()) + ", fbConfigID " + toHexString(fbConfigID) + ",\n\trequested " + getRequestedCapabilities()+ ",\n\tchosen " + getChosenCapabilities()+ "]"; diff --git a/src/jogl/classes/com/sun/opengl/impl/x11/glx/X11GLXGraphicsConfigurationFactory.java b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLXGraphicsConfigurationFactory.java index 808f2ab7d..e65fb5e90 100644 --- a/src/jogl/classes/com/sun/opengl/impl/x11/glx/X11GLXGraphicsConfigurationFactory.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLXGraphicsConfigurationFactory.java @@ -30,18 +30,16 @@ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ -package com.sun.opengl.impl.x11.glx; +package com.jogamp.opengl.impl.x11.glx; +import com.jogamp.common.nio.PointerBuffer; import javax.media.nativewindow.*; import javax.media.nativewindow.x11.*; -import com.sun.nativewindow.impl.NativeWindowFactoryImpl; -import com.sun.nativewindow.impl.x11.*; +import com.jogamp.nativewindow.impl.x11.*; import javax.media.opengl.*; -import com.sun.opengl.impl.*; -import com.sun.opengl.impl.x11.glx.*; +import com.jogamp.opengl.impl.*; -import com.sun.gluegen.runtime.PointerBuffer; /** Subclass of GraphicsConfigurationFactory used when non-AWT tookits are used on X11 platforms. Toolkits will likely need to delegate @@ -61,7 +59,8 @@ public class X11GLXGraphicsConfigurationFactory extends GraphicsConfigurationFac return chooseGraphicsConfigurationStatic(capabilities, chooser, absScreen); } - protected static X11GLXGraphicsConfiguration createDefaultGraphicsConfiguration(AbstractGraphicsScreen absScreen, boolean onscreen, boolean usePBuffer) { + /** + protected static X11GLXGraphicsConfiguration createDefaultGraphicsConfigurationFBConfig(AbstractGraphicsScreen absScreen, boolean onscreen, boolean usePBuffer) { if (absScreen == null) { throw new IllegalArgumentException("AbstractGraphicsScreen is null"); } @@ -80,9 +79,10 @@ public class X11GLXGraphicsConfigurationFactory extends GraphicsConfigurationFac // GLCapabilities capsFB = null; long display = x11Screen.getDevice().getHandle(); + + NativeWindowFactory.getDefaultFactory().getToolkitLock().lock(); + X11Lib.XLockDisplay(display); try { - NativeWindowFactory.getDefaultFactory().getToolkitLock().lock(); - X11Lib.XLockDisplay(display); int screen = x11Screen.getIndex(); boolean isMultisampleAvailable = GLXUtil.isMultisampleAvailable(display); @@ -112,7 +112,7 @@ public class X11GLXGraphicsConfigurationFactory extends GraphicsConfigurationFac } return new X11GLXGraphicsConfiguration(x11Screen, (null!=capsFB)?capsFB:caps, caps, null, xvis, fbcfg, fbid); - } + } */ protected static X11GLXGraphicsConfiguration chooseGraphicsConfigurationStatic(Capabilities capabilities, CapabilitiesChooser chooser, @@ -145,7 +145,7 @@ public class X11GLXGraphicsConfigurationFactory extends GraphicsConfigurationFac GLCapabilities caps2 = (GLCapabilities) capabilities.clone(); if(!caps2.isOnscreen()) { - // OFFSCREEN !DOUBLE_BUFFER + // OFFSCREEN !DOUBLE_BUFFER // FIXME DBLBUFOFFSCRN caps2.setDoubleBuffered(false); } @@ -155,14 +155,14 @@ public class X11GLXGraphicsConfigurationFactory extends GraphicsConfigurationFac x11Screen); if(null==res) { if(usePBuffer) { - throw new GLException("Error: Couldn't create X11GLXGraphicsConfiguration based on FBConfig"); + throw new GLException("Error: Couldn't create X11GLXGraphicsConfiguration based on FBConfig for "+caps2); } res = chooseGraphicsConfigurationXVisual((GLCapabilities) caps2, (GLCapabilitiesChooser) chooser, x11Screen); } if(null==res) { - throw new GLException("Error: Couldn't create X11GLXGraphicsConfiguration"); + throw new GLException("Error: Couldn't create X11GLXGraphicsConfiguration based on FBConfig and XVisual for "+caps2); } if(DEBUG) { System.err.println("X11GLXGraphicsConfiguration.chooseGraphicsConfigurationStatic("+x11Screen+","+caps2+"): "+res); @@ -173,6 +173,7 @@ public class X11GLXGraphicsConfigurationFactory extends GraphicsConfigurationFac protected static X11GLXGraphicsConfiguration chooseGraphicsConfigurationFBConfig(GLCapabilities capabilities, GLCapabilitiesChooser chooser, X11GraphicsScreen x11Screen) { + long recommendedFBConfig = 0; int recommendedIndex = -1; GLCapabilities[] caps = null; PointerBuffer fbcfgsL = null; @@ -187,70 +188,113 @@ public class X11GLXGraphicsConfigurationFactory extends GraphicsConfigurationFac // AbstractGraphicsDevice absDevice = x11Screen.getDevice(); long display = absDevice.getHandle(); + + NativeWindowFactory.getDefaultFactory().getToolkitLock().lock(); try { - NativeWindowFactory.getDefaultFactory().getToolkitLock().lock(); X11Lib.XLockDisplay(display); - int screen = x11Screen.getIndex(); - boolean isMultisampleAvailable = GLXUtil.isMultisampleAvailable(display); - int[] attribs = X11GLXGraphicsConfiguration.GLCapabilities2AttribList(capabilities, true, isMultisampleAvailable, display, screen); - int[] count = { -1 }; - - fbcfgsL = GLX.glXChooseFBConfigCopied(display, screen, attribs, 0, count, 0); - if (fbcfgsL == null || fbcfgsL.limit()<1) { - if(DEBUG) { - System.err.println("X11GLXGraphicsConfiguration.chooseGraphicsConfigurationFBConfig: Failed glXChooseFBConfig ("+x11Screen+","+capabilities+"): "+fbcfgsL+", "+count[0]); + try{ + int screen = x11Screen.getIndex(); + boolean isMultisampleAvailable = GLXUtil.isMultisampleAvailable(display); + int[] attribs = X11GLXGraphicsConfiguration.GLCapabilities2AttribList(capabilities, true, isMultisampleAvailable, display, screen); + int[] count = { -1 }; + + // determine the recommended FBConfig .. + fbcfgsL = GLX.glXChooseFBConfigCopied(display, screen, attribs, 0, count, 0); + if (fbcfgsL == null || fbcfgsL.limit()<1) { + if(DEBUG) { + System.err.println("X11GLXGraphicsConfiguration.chooseGraphicsConfigurationFBConfig: Failed glXChooseFBConfig ("+x11Screen+","+capabilities+"): "+fbcfgsL+", "+count[0]); + } + } else if( !X11GLXGraphicsConfiguration.GLXFBConfigValid( display, fbcfgsL.get(0) ) ) { + if(DEBUG) { + System.err.println("X11GLXGraphicsConfiguration.chooseGraphicsConfigurationFBConfig: Failed - GLX FBConfig invalid: ("+x11Screen+","+capabilities+"): "+fbcfgsL+", fbcfg: "+toHexString(fbcfgsL.get(0))); + } + } else { + recommendedFBConfig = fbcfgsL.get(0); } - return null; - } - if( !X11GLXGraphicsConfiguration.GLXFBConfigValid( display, fbcfgsL.get(0) ) ) { - if(DEBUG) { - System.err.println("X11GLXGraphicsConfiguration.chooseGraphicsConfigurationFBConfig: Failed - GLX FBConfig invalid: ("+x11Screen+","+capabilities+"): "+fbcfgsL+", fbcfg: 0x"+Long.toHexString(fbcfgsL.get(0))); + + // get all, glXChooseFBConfig(.. attribs==null ..) == glXGetFBConfig(..) + fbcfgsL = GLX.glXChooseFBConfigCopied(display, screen, null, 0, count, 0); + if (fbcfgsL == null || fbcfgsL.limit()<1) { + if(DEBUG) { + System.err.println("X11GLXGraphicsConfiguration.chooseGraphicsConfigurationFBConfig: Failed glXGetFBConfig ("+x11Screen+"): "+fbcfgsL+", "+count[0]); + } + return null; } - return null; - } - recommendedIndex = 0; // 1st match is always recommended .. - caps = new GLCapabilities[fbcfgsL.limit()]; - for (int i = 0; i < fbcfgsL.limit(); i++) { - caps[i] = X11GLXGraphicsConfiguration.GLXFBConfig2GLCapabilities(glProfile, display, fbcfgsL.get(i), - false, onscreen, usePBuffer, isMultisampleAvailable); - } - if(null==chooser) { - chosen = recommendedIndex; - } else { - try { - chosen = chooser.chooseCapabilities(capabilities, caps, recommendedIndex); - } catch (NativeWindowException e) { - if(DEBUG) { - e.printStackTrace(); - } - chosen = -1; + // make GLCapabilities and seek the recommendedIndex + caps = new GLCapabilities[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: ("+x11Screen+","+capabilities+"): fbcfg: "+toHexString(fbcfgsL.get(i))); + } + } else { + caps[i] = X11GLXGraphicsConfiguration.GLXFBConfig2GLCapabilities(glProfile, display, fbcfgsL.get(i), + false, onscreen, usePBuffer, isMultisampleAvailable); + if(caps[i]!=null && recommendedFBConfig==fbcfgsL.get(i)) { + recommendedIndex=i; + if (DEBUG) { + System.err.println("!!! glXChooseFBConfig recommended "+i+", "+caps[i]); + } + } + } } - } - if (chosen < 0) { - // keep on going .. - if(DEBUG) { - System.err.println("X11GLXGraphicsConfiguration.chooseGraphicsConfigurationFBConfig 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) + ")"); - } - retFBID = X11GLXGraphicsConfiguration.glXFBConfig2FBConfigID(display, fbcfgsL.get(chosen)); + if(null==chooser) { + chosen = recommendedIndex; // may still be -1 in case nothing was recommended (-1) + } - retXVisualInfo = GLX.glXGetVisualFromFBConfigCopied(display, fbcfgsL.get(chosen)); - if (retXVisualInfo==null) { - if(DEBUG) { - System.err.println("X11GLXGraphicsConfiguration.chooseGraphicsConfigurationFBConfig: Failed glXGetVisualFromFBConfig ("+x11Screen+", "+fbcfgsL.get(chosen) +" (Continue: "+(false==caps[chosen].isOnscreen())+"):\n\t"+caps[chosen]); + if (chosen < 0) { + if(null==chooser) { + // nothing recommended .. so use our default implementation + chooser = new DefaultGLCapabilitiesChooser(); + } + try { + chosen = chooser.chooseCapabilities(capabilities, caps, recommendedIndex); + } catch (NativeWindowException e) { + if(DEBUG) { + e.printStackTrace(); + } + chosen = -1; + } } - if(caps[chosen].isOnscreen()) { - // Onscreen drawables shall have a XVisual .. + if (chosen < 0) { + // keep on going .. + if(DEBUG) { + System.err.println("X11GLXGraphicsConfiguration.chooseGraphicsConfigurationFBConfig Failed .. unable to choose config, using first"); + } + // seek first available one .. + for(chosen = 0; chosen < caps.length && caps[chosen]==null; chosen++) ; + if(chosen==caps.length) { + // give up .. + if(DEBUG) { + System.err.println("X11GLXGraphicsConfiguration.chooseGraphicsConfigurationFBConfig Failed .. nothing available, bail out"); + } + return null; + } + } else if (chosen >= caps.length) { + if(DEBUG) { + System.err.println("GLCapabilitiesChooser specified invalid index (expected 0.." + (caps.length - 1) + ", got "+chosen+")"); + } return null; } + + retFBID = X11GLXGraphicsConfiguration.glXFBConfig2FBConfigID(display, fbcfgsL.get(chosen)); + + retXVisualInfo = GLX.glXGetVisualFromFBConfigCopied(display, fbcfgsL.get(chosen)); + if (retXVisualInfo==null) { + if(DEBUG) { + System.err.println("X11GLXGraphicsConfiguration.chooseGraphicsConfigurationFBConfig: Failed glXGetVisualFromFBConfig ("+x11Screen+", "+fbcfgsL.get(chosen) +" (Continue: "+(false==caps[chosen].isOnscreen())+"):\n\t"+caps[chosen]); + } + if(caps[chosen].isOnscreen()) { + // Onscreen drawables shall have a XVisual .. + return null; + } + } + }finally{ + X11Lib.XUnlockDisplay(display); } } finally { - X11Lib.XUnlockDisplay(display); NativeWindowFactory.getDefaultFactory().getToolkitLock().unlock(); } @@ -277,64 +321,77 @@ public class X11GLXGraphicsConfigurationFactory extends GraphicsConfigurationFac AbstractGraphicsDevice absDevice = x11Screen.getDevice(); long display = absDevice.getHandle(); + + NativeWindowFactory.getDefaultFactory().getToolkitLock().lock(); try { - NativeWindowFactory.getDefaultFactory().getToolkitLock().lock(); X11Lib.XLockDisplay(display); - int screen = x11Screen.getIndex(); - boolean isMultisampleAvailable = GLXUtil.isMultisampleAvailable(display); - int[] attribs = X11GLXGraphicsConfiguration.GLCapabilities2AttribList(capabilities, false, isMultisampleAvailable, display, screen); - XVisualInfo[] infos = null; - - XVisualInfo recommendedVis = GLX.glXChooseVisualCopied(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 0x" + Long.toHexString(recommendedVis.getVisualid())); + try{ + int screen = x11Screen.getIndex(); + boolean isMultisampleAvailable = GLXUtil.isMultisampleAvailable(display); + int[] attribs = X11GLXGraphicsConfiguration.GLCapabilities2AttribList(capabilities, false, isMultisampleAvailable, display, screen); + XVisualInfo[] infos = null; + + XVisualInfo recommendedVis = GLX.glXChooseVisualCopied(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 = X11Lib.XGetVisualInfoCopied(display, X11Lib.VisualScreenMask, template, count, 0); - if (infos == null || infos.length<1) { - throw new GLException("Error while enumerating available XVisualInfos"); - } - caps = new GLCapabilities[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 chosen by glXChooseVisual - if (recommendedVis != null && recommendedVis.getVisualid() == infos[i].getVisualid()) { - recommendedIndex = i; + int[] count = new int[1]; + XVisualInfo template = XVisualInfo.create(); + template.setScreen(screen); + infos = X11Lib.XGetVisualInfoCopied(display, X11Lib.VisualScreenMask, template, count, 0); + if (infos == null || infos.length<1) { + throw new GLException("Error while enumerating available XVisualInfos"); } + caps = new GLCapabilities[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 chosen by glXChooseVisual + if (recommendedVis != null && recommendedVis.getVisualid() == infos[i].getVisualid()) { + recommendedIndex = i; + } + } + try { + chosen = chooser.chooseCapabilities(capabilities, 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]); + }finally{ + X11Lib.XUnlockDisplay(display); } - try { - chosen = chooser.chooseCapabilities(capabilities, 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"); - } - retXVisualInfo = XVisualInfo.create(infos[chosen]); } finally { - X11Lib.XUnlockDisplay(display); NativeWindowFactory.getDefaultFactory().getToolkitLock().unlock(); } return new X11GLXGraphicsConfiguration(x11Screen, caps[chosen], capabilities, 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/sun/opengl/impl/x11/glx/X11OffscreenGLXContext.java b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11OffscreenGLXContext.java index 7a38f0ce1..bea953ee9 100644 --- a/src/jogl/classes/com/sun/opengl/impl/x11/glx/X11OffscreenGLXContext.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11OffscreenGLXContext.java @@ -37,11 +37,11 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.impl.x11.glx; +package com.jogamp.opengl.impl.x11.glx; import javax.media.opengl.*; -import com.sun.opengl.impl.*; -import com.sun.opengl.impl.x11.*; +import com.jogamp.opengl.impl.*; +import com.jogamp.opengl.impl.x11.*; public class X11OffscreenGLXContext extends X11GLXContext { private X11OffscreenGLXDrawable drawable; @@ -54,7 +54,7 @@ public class X11OffscreenGLXContext extends X11GLXContext { public int getOffscreenContextPixelDataType() { GL gl = getGL(); - return gl.isGL2()?GL2.GL_UNSIGNED_INT_8_8_8_8_REV:GL.GL_UNSIGNED_SHORT_5_5_5_1; + return gl.isGL2GL3()?GL2GL3.GL_UNSIGNED_INT_8_8_8_8_REV:GL.GL_UNSIGNED_SHORT_5_5_5_1; } public int getOffscreenContextReadBuffer() { diff --git a/src/jogl/classes/com/sun/opengl/impl/x11/glx/X11OffscreenGLXDrawable.java b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11OffscreenGLXDrawable.java index 30772f8ab..14d07e74f 100644 --- a/src/jogl/classes/com/sun/opengl/impl/x11/glx/X11OffscreenGLXDrawable.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11OffscreenGLXDrawable.java @@ -37,12 +37,11 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.impl.x11.glx; +package com.jogamp.opengl.impl.x11.glx; import javax.media.nativewindow.*; import javax.media.opengl.*; -import com.sun.opengl.impl.*; -import com.sun.nativewindow.impl.x11.*; +import com.jogamp.nativewindow.impl.x11.*; public class X11OffscreenGLXDrawable extends X11GLXDrawable { private long pixmap; @@ -76,26 +75,30 @@ public class X11OffscreenGLXDrawable extends X11GLXDrawable { getFactoryImpl().lockToolkit(); try { - X11Lib.XLockDisplay(dpy); - pixmap = X11Lib.XCreatePixmap(dpy, (int) X11Lib.RootWindow(dpy, screen), - component.getWidth(), component.getHeight(), bitsPerPixel); - if (pixmap == 0) { - throw new GLException("XCreatePixmap failed"); - } - long drawable = GLX.glXCreateGLXPixmap(dpy, vis, pixmap); - if (drawable == 0) { - X11Lib.XFreePixmap(dpy, pixmap); - pixmap = 0; - throw new GLException("glXCreateGLXPixmap failed"); - } - ((SurfaceChangeable)nw).setSurfaceHandle(drawable); - if (DEBUG) { - System.err.println("Created pixmap " + toHexString(pixmap) + - ", GLXPixmap " + toHexString(drawable) + - ", display " + toHexString(dpy)); - } + X11Lib.XLockDisplay(dpy); + try{ + + pixmap = X11Lib.XCreatePixmap(dpy, X11Lib.RootWindow(dpy, screen), + component.getWidth(), component.getHeight(), bitsPerPixel); + if (pixmap == 0) { + throw new GLException("XCreatePixmap failed"); + } + long drawable = GLX.glXCreateGLXPixmap(dpy, vis, pixmap); + if (drawable == 0) { + X11Lib.XFreePixmap(dpy, pixmap); + pixmap = 0; + throw new GLException("glXCreateGLXPixmap failed"); + } + ((SurfaceChangeable)nw).setSurfaceHandle(drawable); + if (DEBUG) { + System.err.println("Created pixmap " + toHexString(pixmap) + + ", GLXPixmap " + toHexString(drawable) + + ", display " + toHexString(dpy)); + } + }finally{ + X11Lib.XUnlockDisplay(dpy); + } } finally { - X11Lib.XUnlockDisplay(dpy); getFactoryImpl().unlockToolkit(); } } @@ -105,41 +108,45 @@ public class X11OffscreenGLXDrawable extends X11GLXDrawable { NativeWindow nw = getNativeWindow(); long display = nw.getDisplayHandle(); + + getFactoryImpl().lockToolkit(); try { - getFactoryImpl().lockToolkit(); - X11Lib.XLockDisplay(display); - - long drawable = nw.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"); + X11Lib.XLockDisplay(display); + try{ + long drawable = nw.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); + X11Lib.XFreePixmap(display, pixmap); + drawable = 0; + pixmap = 0; + ((SurfaceChangeable)nw).setSurfaceHandle(0); + + }finally{ + X11Lib.XUnlockDisplay(display); } - } - - // 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); - X11Lib.XFreePixmap(display, pixmap); - drawable = 0; - pixmap = 0; - display = 0; - ((SurfaceChangeable)nw).setSurfaceHandle(0); } finally { - X11Lib.XUnlockDisplay(display); getFactoryImpl().unlockToolkit(); + display = 0; } } protected void swapBuffersImpl() { diff --git a/src/jogl/classes/com/sun/opengl/impl/x11/glx/X11OnscreenGLXContext.java b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11OnscreenGLXContext.java index a73b41146..c89a5efd5 100644 --- a/src/jogl/classes/com/sun/opengl/impl/x11/glx/X11OnscreenGLXContext.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11OnscreenGLXContext.java @@ -37,14 +37,14 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.impl.x11.glx; +package com.jogamp.opengl.impl.x11.glx; import java.util.*; import javax.media.nativewindow.*; import javax.media.opengl.*; -import com.sun.opengl.impl.*; -import com.sun.opengl.impl.x11.*; +import com.jogamp.opengl.impl.*; +import com.jogamp.opengl.impl.x11.*; public class X11OnscreenGLXContext extends X11GLXContext { // This indicates whether the context we have created is indirect diff --git a/src/jogl/classes/com/sun/opengl/impl/x11/glx/X11OnscreenGLXDrawable.java b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11OnscreenGLXDrawable.java index 4a81448fd..43468b858 100644 --- a/src/jogl/classes/com/sun/opengl/impl/x11/glx/X11OnscreenGLXDrawable.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11OnscreenGLXDrawable.java @@ -37,12 +37,12 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.impl.x11.glx; +package com.jogamp.opengl.impl.x11.glx; import javax.media.nativewindow.*; import javax.media.opengl.*; -import com.sun.opengl.impl.*; -import com.sun.opengl.impl.x11.*; +import com.jogamp.opengl.impl.*; +import com.jogamp.opengl.impl.x11.*; public class X11OnscreenGLXDrawable extends X11GLXDrawable { protected X11OnscreenGLXDrawable(GLDrawableFactory factory, NativeWindow component) { diff --git a/src/jogl/classes/com/sun/opengl/impl/x11/glx/X11PbufferGLXContext.java b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11PbufferGLXContext.java index 3938c0ecc..1b70adf6b 100644 --- a/src/jogl/classes/com/sun/opengl/impl/x11/glx/X11PbufferGLXContext.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11PbufferGLXContext.java @@ -37,11 +37,11 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.impl.x11.glx; +package com.jogamp.opengl.impl.x11.glx; import javax.media.opengl.*; -import com.sun.opengl.impl.*; -import com.sun.opengl.impl.x11.*; +import com.jogamp.opengl.impl.*; +import com.jogamp.opengl.impl.x11.*; public class X11PbufferGLXContext extends X11GLXContext { private X11PbufferGLXDrawable drawable; @@ -68,33 +68,6 @@ public class X11PbufferGLXContext extends X11GLXContext { } protected void create() { - if (DEBUG) { - System.err.println("Creating context for pbuffer " + drawable.getWidth() + - " x " + drawable.getHeight()); - } - - // Create a gl context for the p-buffer. - X11GLXContext other = (X11GLXContext) GLContextShareSet.getShareContext(this); - long share = 0; - if (other != null) { - share = other.getContext(); - if (share == 0) { - throw new GLException("GLContextShareSet returned an invalid OpenGL context"); - } - } - X11GLXGraphicsConfiguration config = (X11GLXGraphicsConfiguration) - getGLDrawable().getNativeWindow().getGraphicsConfiguration().getNativeGraphicsConfiguration(); - - context = GLX.glXCreateNewContext(drawable.getNativeWindow().getDisplayHandle(), - config.getFBConfig(), GLX.GLX_RGBA_TYPE, share, true); - if (context == 0) { - throw new GLException("pbuffer creation error: glXCreateNewContext() failed"); - } - GLContextShareSet.contextCreated(this); - - if (DEBUG) { - System.err.println("Created context for pbuffer " + drawable.getWidth() + - " x " + drawable.getHeight()); - } + createContext(true); } } diff --git a/src/jogl/classes/com/sun/opengl/impl/x11/glx/X11PbufferGLXDrawable.java b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11PbufferGLXDrawable.java index e87ef54ac..50b32b9ec 100644 --- a/src/jogl/classes/com/sun/opengl/impl/x11/glx/X11PbufferGLXDrawable.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11PbufferGLXDrawable.java @@ -37,13 +37,13 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.impl.x11.glx; +package com.jogamp.opengl.impl.x11.glx; import javax.media.opengl.*; import javax.media.nativewindow.*; -import com.sun.opengl.impl.*; -import com.sun.opengl.impl.x11.glx.*; -import com.sun.nativewindow.impl.x11.*; +import com.jogamp.opengl.impl.*; +import com.jogamp.opengl.impl.x11.glx.*; +import com.jogamp.nativewindow.impl.x11.*; public class X11PbufferGLXDrawable extends X11GLXDrawable { protected X11PbufferGLXDrawable(GLDrawableFactory factory, NativeWindow target) { diff --git a/src/jogl/classes/com/sun/opengl/impl/x11/glx/awt/X11AWTGLXGraphicsConfigurationFactory.java b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/awt/X11AWTGLXGraphicsConfigurationFactory.java index 1b92e6f86..dc6c60664 100644 --- a/src/jogl/classes/com/sun/opengl/impl/x11/glx/awt/X11AWTGLXGraphicsConfigurationFactory.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/awt/X11AWTGLXGraphicsConfigurationFactory.java @@ -30,7 +30,7 @@ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ -package com.sun.opengl.impl.x11.glx.awt; +package com.jogamp.opengl.impl.x11.glx.awt; import java.awt.GraphicsConfiguration; import java.awt.GraphicsDevice; @@ -41,12 +41,12 @@ import javax.media.nativewindow.awt.*; import javax.media.opengl.*; import javax.media.opengl.awt.*; -import com.sun.opengl.impl.*; -import com.sun.nativewindow.impl.jawt.*; -import com.sun.nativewindow.impl.jawt.x11.*; -import com.sun.nativewindow.impl.x11.*; -import com.sun.opengl.impl.x11.*; -import com.sun.opengl.impl.x11.glx.*; +import com.jogamp.opengl.impl.*; +import com.jogamp.nativewindow.impl.jawt.*; +import com.jogamp.nativewindow.impl.jawt.x11.*; +import com.jogamp.nativewindow.impl.x11.*; +import com.jogamp.opengl.impl.x11.*; +import com.jogamp.opengl.impl.x11.glx.*; public class X11AWTGLXGraphicsConfigurationFactory extends GraphicsConfigurationFactory { protected static final boolean DEBUG = Debug.debug("GraphicsConfiguration"); @@ -92,7 +92,7 @@ public class X11AWTGLXGraphicsConfigurationFactory extends GraphicsConfiguration try { long displayHandle = X11SunJDKReflection.graphicsDeviceGetDisplay(device); if(0==displayHandle) { - displayHandle = X11Util.getThreadLocalDefaultDisplay(); + displayHandle = X11Util.createThreadLocalDefaultDisplay(); if(DEBUG) { System.err.println("X11AWTGLXGraphicsConfigurationFactory: using a thread local X11 display"); } diff --git a/src/jogl/classes/com/sun/opengl/util/AWTAnimatorImpl.java b/src/jogl/classes/com/jogamp/opengl/util/AWTAnimatorImpl.java index 9809e44d2..d8e1cf080 100644 --- a/src/jogl/classes/com/sun/opengl/util/AWTAnimatorImpl.java +++ b/src/jogl/classes/com/jogamp/opengl/util/AWTAnimatorImpl.java @@ -30,7 +30,7 @@ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ -package com.sun.opengl.util; +package com.jogamp.opengl.util; import java.awt.Component; import java.awt.EventQueue; diff --git a/src/jogl/classes/com/sun/opengl/util/Animator.java b/src/jogl/classes/com/jogamp/opengl/util/Animator.java index 1d4b832e8..30be0bd90 100755 --- a/src/jogl/classes/com/sun/opengl/util/Animator.java +++ b/src/jogl/classes/com/jogamp/opengl/util/Animator.java @@ -37,13 +37,13 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.util; +package com.jogamp.opengl.util; import java.util.*; import javax.media.opengl.*; -import com.sun.opengl.impl.Debug; +import com.jogamp.opengl.impl.Debug; /** <P> An Animator can be attached to one or more {@link GLAutoDrawable}s to drive their display() methods in a loop. </P> @@ -72,7 +72,7 @@ public class Animator { if(GLProfile.isAWTJOGLAvailable()) { try { - impl = (AnimatorImpl) Class.forName("com.sun.opengl.util.awt.AWTAnimatorImpl").newInstance(); + impl = (AnimatorImpl) Class.forName("com.jogamp.opengl.util.awt.AWTAnimatorImpl").newInstance(); } catch (Exception e) { } } if(null==impl) { diff --git a/src/jogl/classes/com/sun/opengl/util/AnimatorImpl.java b/src/jogl/classes/com/jogamp/opengl/util/AnimatorImpl.java index 8bba4b71a..50b91b729 100644 --- a/src/jogl/classes/com/sun/opengl/util/AnimatorImpl.java +++ b/src/jogl/classes/com/jogamp/opengl/util/AnimatorImpl.java @@ -30,7 +30,7 @@ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ -package com.sun.opengl.util; +package com.jogamp.opengl.util; import java.util.*; import javax.media.opengl.*; diff --git a/src/jogl/classes/com/sun/opengl/util/FBObject.java b/src/jogl/classes/com/jogamp/opengl/util/FBObject.java index 84b79dff4..4920ed5f5 100755 --- a/src/jogl/classes/com/sun/opengl/util/FBObject.java +++ b/src/jogl/classes/com/jogamp/opengl/util/FBObject.java @@ -31,7 +31,7 @@ * */ -package com.sun.opengl.util; +package com.jogamp.opengl.util; import javax.media.opengl.*; diff --git a/src/jogl/classes/com/sun/opengl/util/FPSAnimator.java b/src/jogl/classes/com/jogamp/opengl/util/FPSAnimator.java index 290de89d6..75c4cdff7 100755 --- a/src/jogl/classes/com/sun/opengl/util/FPSAnimator.java +++ b/src/jogl/classes/com/jogamp/opengl/util/FPSAnimator.java @@ -37,7 +37,7 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.util; +package com.jogamp.opengl.util; import java.util.*; import javax.media.opengl.*; diff --git a/src/jogl/classes/com/sun/opengl/util/FileUtil.java b/src/jogl/classes/com/jogamp/opengl/util/FileUtil.java index 84b846853..6ad0da825 100755 --- a/src/jogl/classes/com/sun/opengl/util/FileUtil.java +++ b/src/jogl/classes/com/jogamp/opengl/util/FileUtil.java @@ -37,7 +37,7 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.util; +package com.jogamp.opengl.util; import java.io.*; diff --git a/src/jogl/classes/com/sun/opengl/util/FixedPoint.java b/src/jogl/classes/com/jogamp/opengl/util/FixedPoint.java index e9bdae0e9..6412db5ef 100644 --- a/src/jogl/classes/com/sun/opengl/util/FixedPoint.java +++ b/src/jogl/classes/com/jogamp/opengl/util/FixedPoint.java @@ -31,7 +31,7 @@ * */ -package com.sun.opengl.util; +package com.jogamp.opengl.util; public class FixedPoint { public static final int toFixed(int value) { diff --git a/src/jogl/classes/com/sun/opengl/util/GLArrayDataClient.java b/src/jogl/classes/com/jogamp/opengl/util/GLArrayDataClient.java index ec4c5e393..1141f6624 100644 --- a/src/jogl/classes/com/sun/opengl/util/GLArrayDataClient.java +++ b/src/jogl/classes/com/jogamp/opengl/util/GLArrayDataClient.java @@ -1,13 +1,14 @@ -package com.sun.opengl.util; +package com.jogamp.opengl.util; +import com.jogamp.common.nio.Buffers; import java.security.*; import javax.media.opengl.*; -import com.sun.opengl.util.glsl.*; +import com.jogamp.opengl.util.glsl.*; -import com.sun.opengl.impl.SystemUtil; +import com.jogamp.opengl.impl.SystemUtil; import java.nio.*; @@ -189,7 +190,7 @@ public class GLArrayDataClient extends GLArrayDataWrapper implements GLArrayData public void padding(int done) { if ( buffer==null || sealed ) return; while(done<strideL) { - BufferUtil.putb(buffer, (byte)0); + Buffers.putb(buffer, (byte)0); done++; } } @@ -206,25 +207,25 @@ public class GLArrayDataClient extends GLArrayDataWrapper implements GLArrayData throw new GLException("Buffer length ("+v.remaining()+") is not a multiple of component-stride:\n\t"+this); } growBufferIfNecessary(v.remaining()); - BufferUtil.put(buffer, v); + Buffers.put(buffer, v); } public void putb(byte v) { if ( buffer==null || sealed ) return; growBufferIfNecessary(1); - BufferUtil.putb(buffer, v); + Buffers.putb(buffer, v); } public void puts(short v) { if ( buffer==null || sealed ) return; growBufferIfNecessary(1); - BufferUtil.puts(buffer, v); + Buffers.puts(buffer, v); } public void puti(int v) { if ( buffer==null || sealed ) return; growBufferIfNecessary(1); - BufferUtil.puti(buffer, v); + Buffers.puti(buffer, v); } public void putx(int v) { @@ -234,7 +235,7 @@ public class GLArrayDataClient extends GLArrayDataWrapper implements GLArrayData public void putf(float v) { if ( buffer==null || sealed ) return; growBufferIfNecessary(1); - BufferUtil.putf(buffer, v); + Buffers.putf(buffer, v); } public String toString() { @@ -274,28 +275,28 @@ public class GLArrayDataClient extends GLArrayDataWrapper implements GLArrayData if(components>0) { int osize = (buffer!=null)?buffer.capacity():0; if(clazz==ByteBuffer.class) { - ByteBuffer newBBuffer = BufferUtil.newByteBuffer( (osize+additional) * components ); + ByteBuffer newBBuffer = Buffers.newDirectByteBuffer( (osize+additional) * components ); if(buffer!=null) { buffer.flip(); newBBuffer.put((ByteBuffer)buffer); } buffer = newBBuffer; } else if(clazz==ShortBuffer.class) { - ShortBuffer newSBuffer = BufferUtil.newShortBuffer( (osize+additional) * components ); + ShortBuffer newSBuffer = Buffers.newDirectShortBuffer( (osize+additional) * components ); if(buffer!=null) { buffer.flip(); newSBuffer.put((ShortBuffer)buffer); } buffer = newSBuffer; } else if(clazz==IntBuffer.class) { - IntBuffer newIBuffer = BufferUtil.newIntBuffer( (osize+additional) * components ); + IntBuffer newIBuffer = Buffers.newDirectIntBuffer( (osize+additional) * components ); if(buffer!=null) { buffer.flip(); newIBuffer.put((IntBuffer)buffer); } buffer = newIBuffer; } else if(clazz==FloatBuffer.class) { - FloatBuffer newFBuffer = BufferUtil.newFloatBuffer( (osize+additional) * components ); + FloatBuffer newFBuffer = Buffers.newDirectFloatBuffer( (osize+additional) * components ); if(buffer!=null) { buffer.flip(); newFBuffer.put((FloatBuffer)buffer); diff --git a/src/jogl/classes/com/sun/opengl/util/GLArrayDataEditable.java b/src/jogl/classes/com/jogamp/opengl/util/GLArrayDataEditable.java index c8fcbf573..0f8ed27be 100644 --- a/src/jogl/classes/com/sun/opengl/util/GLArrayDataEditable.java +++ b/src/jogl/classes/com/jogamp/opengl/util/GLArrayDataEditable.java @@ -1,5 +1,5 @@ -package com.sun.opengl.util; +package com.jogamp.opengl.util; import javax.media.opengl.*; diff --git a/src/jogl/classes/com/sun/opengl/util/GLArrayDataServer.java b/src/jogl/classes/com/jogamp/opengl/util/GLArrayDataServer.java index dc233ce36..c061e212a 100644 --- a/src/jogl/classes/com/sun/opengl/util/GLArrayDataServer.java +++ b/src/jogl/classes/com/jogamp/opengl/util/GLArrayDataServer.java @@ -1,10 +1,10 @@ -package com.sun.opengl.util; +package com.jogamp.opengl.util; import javax.media.opengl.*; import java.nio.*; -import com.sun.opengl.util.glsl.*; +import com.jogamp.opengl.util.glsl.*; public class GLArrayDataServer extends GLArrayDataClient implements GLArrayDataEditable { diff --git a/src/jogl/classes/com/sun/opengl/util/GLArrayDataWrapper.java b/src/jogl/classes/com/jogamp/opengl/util/GLArrayDataWrapper.java index 72e7c19bb..2ab77fa1b 100644 --- a/src/jogl/classes/com/sun/opengl/util/GLArrayDataWrapper.java +++ b/src/jogl/classes/com/jogamp/opengl/util/GLArrayDataWrapper.java @@ -1,9 +1,9 @@ -package com.sun.opengl.util; +package com.jogamp.opengl.util; import javax.media.opengl.*; -import com.sun.opengl.util.glsl.fixedfunc.impl.*; +import com.jogamp.opengl.util.glsl.fixedfunc.impl.*; import java.nio.*; @@ -65,16 +65,16 @@ public class GLArrayDataWrapper implements GLArrayData { public final int getComponentSize() { if(clazz==ByteBuffer.class) { - return BufferUtil.SIZEOF_BYTE; + return GLBuffers.SIZEOF_BYTE; } if(clazz==ShortBuffer.class) { - return BufferUtil.SIZEOF_SHORT; + return GLBuffers.SIZEOF_SHORT; } if(clazz==IntBuffer.class) { - return BufferUtil.SIZEOF_INT; + return GLBuffers.SIZEOF_INT; } if(clazz==FloatBuffer.class) { - return BufferUtil.SIZEOF_FLOAT; + return GLBuffers.SIZEOF_FLOAT; } throw new GLException("Given Buffer Class not supported: "+clazz+":\n\t"+this); } diff --git a/src/jogl/classes/com/sun/opengl/util/GLArrayHandler.java b/src/jogl/classes/com/jogamp/opengl/util/GLArrayHandler.java index 9443ad6ed..bfabb5b01 100644 --- a/src/jogl/classes/com/sun/opengl/util/GLArrayHandler.java +++ b/src/jogl/classes/com/jogamp/opengl/util/GLArrayHandler.java @@ -1,5 +1,5 @@ -package com.sun.opengl.util; +package com.jogamp.opengl.util; import javax.media.opengl.*; diff --git a/src/jogl/classes/com/jogamp/opengl/util/GLBuffers.java b/src/jogl/classes/com/jogamp/opengl/util/GLBuffers.java new file mode 100755 index 000000000..efe3a7675 --- /dev/null +++ b/src/jogl/classes/com/jogamp/opengl/util/GLBuffers.java @@ -0,0 +1,137 @@ +/* + * 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. + * + * 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; + +import com.jogamp.common.nio.Buffers; +import javax.media.opengl.GL; +import javax.media.opengl.GL2; +import javax.media.opengl.GL2ES2; + +import java.nio.*; + +/** + * Utility routines for dealing with direct buffers. + * @author Kenneth Russel + * @author Michael Bien + */ +public class GLBuffers extends Buffers { + + public static final int sizeOfGLType(int glType) { + switch (glType) { + case GL.GL_UNSIGNED_BYTE: + return SIZEOF_BYTE; + case GL.GL_BYTE: + return SIZEOF_BYTE; + case GL.GL_UNSIGNED_SHORT: + return SIZEOF_SHORT; + case GL.GL_SHORT: + return SIZEOF_SHORT; + case GL.GL_FLOAT: + return SIZEOF_FLOAT; + case GL.GL_FIXED: + return SIZEOF_INT; + case GL2ES2.GL_INT: + return SIZEOF_INT; + case GL2ES2.GL_UNSIGNED_INT: + return SIZEOF_INT; + case GL2.GL_DOUBLE: + return SIZEOF_DOUBLE; + } + return -1; + } + + public static final Buffer newDirectGLBuffer(int glType, int numElements) { + switch (glType) { + case GL.GL_UNSIGNED_BYTE: + case GL.GL_BYTE: + return newDirectByteBuffer(numElements); + case GL.GL_UNSIGNED_SHORT: + case GL.GL_SHORT: + return newDirectShortBuffer(numElements); + case GL.GL_FLOAT: + return newDirectFloatBuffer(numElements); + case GL.GL_FIXED: + case GL2ES2.GL_INT: + case GL2ES2.GL_UNSIGNED_INT: + return newDirectIntBuffer(numElements); + case GL2.GL_DOUBLE: + return newDirectDoubleBuffer(numElements); + } + return null; + } + + public static final Buffer sliceGLBuffer(ByteBuffer parent, int bytePos, int byteLen, int glType) { + if (parent == null || byteLen == 0) { + return null; + } + parent.position(bytePos); + parent.limit(bytePos + byteLen); + + switch (glType) { + case GL.GL_UNSIGNED_BYTE: + case GL.GL_BYTE: + return parent.slice(); + case GL.GL_UNSIGNED_SHORT: + case GL.GL_SHORT: + return parent.asShortBuffer(); + case GL.GL_FLOAT: + return parent.asFloatBuffer(); + case GL.GL_FIXED: + case GL2ES2.GL_INT: + case GL2ES2.GL_UNSIGNED_INT: + return parent.asIntBuffer(); + case GL2.GL_DOUBLE: + return parent.asDoubleBuffer(); + } + return null; + } + + //---------------------------------------------------------------------- + // Conversion routines + // + public final static float[] getFloatArray(double[] source) { + int i = source.length; + float[] dest = new float[i--]; + while (i >= 0) { + dest[i] = (float) source[i]; + i--; + } + return dest; + } +} diff --git a/src/jogl/classes/com/sun/opengl/util/GLFixedArrayHandler.java b/src/jogl/classes/com/jogamp/opengl/util/GLFixedArrayHandler.java index f1e2502be..f0f5ea896 100644 --- a/src/jogl/classes/com/sun/opengl/util/GLFixedArrayHandler.java +++ b/src/jogl/classes/com/jogamp/opengl/util/GLFixedArrayHandler.java @@ -1,9 +1,9 @@ -package com.sun.opengl.util; +package com.jogamp.opengl.util; import javax.media.opengl.*; import javax.media.opengl.fixedfunc.*; -import com.sun.opengl.util.*; +import com.jogamp.opengl.util.*; import java.nio.*; public class GLFixedArrayHandler implements GLArrayHandler { diff --git a/src/jogl/classes/com/sun/opengl/util/Gamma.java b/src/jogl/classes/com/jogamp/opengl/util/Gamma.java index da0d7bd96..672325cf3 100755 --- a/src/jogl/classes/com/sun/opengl/util/Gamma.java +++ b/src/jogl/classes/com/jogamp/opengl/util/Gamma.java @@ -37,10 +37,10 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.util; +package com.jogamp.opengl.util; import javax.media.opengl.*; -import com.sun.opengl.impl.*; +import com.jogamp.opengl.impl.*; /** 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/sun/opengl/util/ImmModeSink.java b/src/jogl/classes/com/jogamp/opengl/util/ImmModeSink.java index 65c676f4a..04b994198 100644 --- a/src/jogl/classes/com/sun/opengl/util/ImmModeSink.java +++ b/src/jogl/classes/com/jogamp/opengl/util/ImmModeSink.java @@ -1,9 +1,9 @@ -package com.sun.opengl.util; +package com.jogamp.opengl.util; +import com.jogamp.common.util.*; import javax.media.opengl.*; import javax.media.opengl.fixedfunc.*; -import com.sun.nativewindow.impl.NWReflection; import java.nio.*; import java.util.Iterator; import java.util.ArrayList; @@ -35,8 +35,8 @@ public class ImmModeSink { * a ShaderState must be current, using ShaderState.glUseProgram(). * * @see #draw(GL, boolean) - * @see javax.media.opengl.glsl.ShaderState#glUseProgram(GL2ES2, boolean) - * @see javax.media.opengl.glsl.ShaderState#getCurrent() + * @see com.jogamp.opengl.util.glsl.ShaderState#glUseProgram(GL2ES2, boolean) + * @see com.jogamp.opengl.util.glsl.ShaderState#getCurrent() */ public static ImmModeSink createGLSL(GL gl, int glBufferUsage, int initialSize, int vComps, int vDataType, @@ -341,9 +341,9 @@ public class ImmModeSink { } else { Class clazz = indices.getClass(); int type=-1; - if(NWReflection.instanceOf(clazz, ByteBuffer.class.getName())) { + if(ReflectionUtil.instanceOf(clazz, ByteBuffer.class.getName())) { type = GL.GL_UNSIGNED_BYTE; - } else if(NWReflection.instanceOf(clazz, ShortBuffer.class.getName())) { + } else if(ReflectionUtil.instanceOf(clazz, ShortBuffer.class.getName())) { type = GL.GL_UNSIGNED_SHORT; } if(0>type) { @@ -361,79 +361,79 @@ public class ImmModeSink { public void glVertexv(Buffer v) { checkSeal(false); - BufferUtil.put(vertexArray, v); + GLBuffers.put(vertexArray, v); } public void glNormalv(Buffer v) { checkSeal(false); - BufferUtil.put(normalArray, v); + GLBuffers.put(normalArray, v); } public void glColorv(Buffer v) { checkSeal(false); - BufferUtil.put(colorArray, v); + GLBuffers.put(colorArray, v); } public void glTexCoordv(Buffer v) { checkSeal(false); - BufferUtil.put(textCoordArray, v); + GLBuffers.put(textCoordArray, v); } public void glVertex2b(byte x, byte y) { checkSeal(false); growBufferIfNecessary(VERTEX, 2); if(vComps>0) - BufferUtil.putb(vertexArray, x); + GLBuffers.putb(vertexArray, x); if(vComps>1) - BufferUtil.putb(vertexArray, y); + GLBuffers.putb(vertexArray, y); padding(VERTEX, vComps-2); } public void glVertex3b(byte x, byte y, byte z) { checkSeal(false); growBufferIfNecessary(VERTEX, 3); if(vComps>0) - BufferUtil.putb(vertexArray, x); + GLBuffers.putb(vertexArray, x); if(vComps>1) - BufferUtil.putb(vertexArray, y); + GLBuffers.putb(vertexArray, y); if(vComps>2) - BufferUtil.putb(vertexArray, z); + GLBuffers.putb(vertexArray, z); padding(VERTEX, vComps-3); } public void glVertex2s(short x, short y) { checkSeal(false); growBufferIfNecessary(VERTEX, 2); if(vComps>0) - BufferUtil.puts(vertexArray, x); + GLBuffers.puts(vertexArray, x); if(vComps>1) - BufferUtil.puts(vertexArray, y); + GLBuffers.puts(vertexArray, y); padding(VERTEX, vComps-2); } public void glVertex3s(short x, short y, short z) { checkSeal(false); growBufferIfNecessary(VERTEX, 3); if(vComps>0) - BufferUtil.puts(vertexArray, x); + GLBuffers.puts(vertexArray, x); if(vComps>1) - BufferUtil.puts(vertexArray, y); + GLBuffers.puts(vertexArray, y); if(vComps>2) - BufferUtil.puts(vertexArray, z); + GLBuffers.puts(vertexArray, z); padding(VERTEX, vComps-3); } public void glVertex2f(float x, float y) { checkSeal(false); growBufferIfNecessary(VERTEX, 2); if(vComps>0) - BufferUtil.putf(vertexArray, x); + GLBuffers.putf(vertexArray, x); if(vComps>1) - BufferUtil.putf(vertexArray, y); + GLBuffers.putf(vertexArray, y); padding(VERTEX, vComps-2); } public void glVertex3f(float x, float y, float z) { checkSeal(false); growBufferIfNecessary(VERTEX, 3); if(vComps>0) - BufferUtil.putf(vertexArray, x); + GLBuffers.putf(vertexArray, x); if(vComps>1) - BufferUtil.putf(vertexArray, y); + GLBuffers.putf(vertexArray, y); if(vComps>2) - BufferUtil.putf(vertexArray, z); + GLBuffers.putf(vertexArray, z); padding(VERTEX, vComps-3); } @@ -441,33 +441,33 @@ public class ImmModeSink { checkSeal(false); growBufferIfNecessary(NORMAL, 3); if(nComps>0) - BufferUtil.putb(normalArray, x); + GLBuffers.putb(normalArray, x); if(nComps>1) - BufferUtil.putb(normalArray, y); + GLBuffers.putb(normalArray, y); if(nComps>2) - BufferUtil.putb(normalArray, z); + GLBuffers.putb(normalArray, z); padding(NORMAL, nComps-3); } public void glNormal3s(short x, short y, short z) { checkSeal(false); growBufferIfNecessary(NORMAL, 3); if(nComps>0) - BufferUtil.puts(normalArray, x); + GLBuffers.puts(normalArray, x); if(nComps>1) - BufferUtil.puts(normalArray, y); + GLBuffers.puts(normalArray, y); if(nComps>2) - BufferUtil.puts(normalArray, z); + GLBuffers.puts(normalArray, z); padding(NORMAL, nComps-3); } public void glNormal3f(float x, float y, float z) { checkSeal(false); growBufferIfNecessary(NORMAL, 3); if(nComps>0) - BufferUtil.putf(normalArray, x); + GLBuffers.putf(normalArray, x); if(nComps>1) - BufferUtil.putf(normalArray, y); + GLBuffers.putf(normalArray, y); if(nComps>2) - BufferUtil.putf(normalArray, z); + GLBuffers.putf(normalArray, z); padding(NORMAL, nComps-3); } @@ -475,72 +475,72 @@ public class ImmModeSink { checkSeal(false); growBufferIfNecessary(COLOR, 3); if(cComps>0) - BufferUtil.putb(colorArray, r); + GLBuffers.putb(colorArray, r); if(cComps>1) - BufferUtil.putb(colorArray, g); + GLBuffers.putb(colorArray, g); if(cComps>2) - BufferUtil.putb(colorArray, b); + GLBuffers.putb(colorArray, b); padding(COLOR, cComps-3); } public void glColor4b(byte r, byte g, byte b, byte a) { checkSeal(false); growBufferIfNecessary(COLOR, 4); if(cComps>0) - BufferUtil.putb(colorArray, r); + GLBuffers.putb(colorArray, r); if(cComps>1) - BufferUtil.putb(colorArray, g); + GLBuffers.putb(colorArray, g); if(cComps>2) - BufferUtil.putb(colorArray, b); + GLBuffers.putb(colorArray, b); if(cComps>3) - BufferUtil.putb(colorArray, a); + GLBuffers.putb(colorArray, a); padding(COLOR, cComps-4); } public void glColor3s(short r, short g, short b) { checkSeal(false); growBufferIfNecessary(COLOR, 3); if(cComps>0) - BufferUtil.puts(colorArray, r); + GLBuffers.puts(colorArray, r); if(cComps>1) - BufferUtil.puts(colorArray, g); + GLBuffers.puts(colorArray, g); if(cComps>2) - BufferUtil.puts(colorArray, b); + GLBuffers.puts(colorArray, b); padding(COLOR, cComps-3); } public void glColor4s(short r, short g, short b, short a) { checkSeal(false); growBufferIfNecessary(COLOR, 4); if(cComps>0) - BufferUtil.puts(colorArray, r); + GLBuffers.puts(colorArray, r); if(cComps>1) - BufferUtil.puts(colorArray, g); + GLBuffers.puts(colorArray, g); if(cComps>2) - BufferUtil.puts(colorArray, b); + GLBuffers.puts(colorArray, b); if(cComps>3) - BufferUtil.puts(colorArray, a); + GLBuffers.puts(colorArray, a); padding(COLOR, cComps-4); } public void glColor3f(float r, float g, float b) { checkSeal(false); growBufferIfNecessary(COLOR, 3); if(cComps>0) - BufferUtil.putf(colorArray, r); + GLBuffers.putf(colorArray, r); if(cComps>1) - BufferUtil.putf(colorArray, g); + GLBuffers.putf(colorArray, g); if(cComps>2) - BufferUtil.putf(colorArray, b); + GLBuffers.putf(colorArray, b); padding(COLOR, cComps-3); } public void glColor4f(float r, float g, float b, float a) { checkSeal(false); growBufferIfNecessary(COLOR, 4); if(cComps>0) - BufferUtil.putf(colorArray, r); + GLBuffers.putf(colorArray, r); if(cComps>1) - BufferUtil.putf(colorArray, g); + GLBuffers.putf(colorArray, g); if(cComps>2) - BufferUtil.putf(colorArray, b); + GLBuffers.putf(colorArray, b); if(cComps>3) - BufferUtil.putf(colorArray, a); + GLBuffers.putf(colorArray, a); padding(COLOR, cComps-4); } @@ -548,60 +548,60 @@ public class ImmModeSink { checkSeal(false); growBufferIfNecessary(TEXTCOORD, 2); if(tComps>0) - BufferUtil.putb(textCoordArray, x); + GLBuffers.putb(textCoordArray, x); if(tComps>1) - BufferUtil.putb(textCoordArray, y); + GLBuffers.putb(textCoordArray, y); padding(TEXTCOORD, tComps-2); } public void glTexCoord3b(byte x, byte y, byte z) { checkSeal(false); growBufferIfNecessary(TEXTCOORD, 3); if(tComps>0) - BufferUtil.putb(textCoordArray, x); + GLBuffers.putb(textCoordArray, x); if(tComps>1) - BufferUtil.putb(textCoordArray, y); + GLBuffers.putb(textCoordArray, y); if(tComps>2) - BufferUtil.putb(textCoordArray, z); + GLBuffers.putb(textCoordArray, z); padding(TEXTCOORD, tComps-3); } public void glTexCoord2s(short x, short y) { checkSeal(false); growBufferIfNecessary(TEXTCOORD, 2); if(tComps>0) - BufferUtil.puts(textCoordArray, x); + GLBuffers.puts(textCoordArray, x); if(tComps>1) - BufferUtil.puts(textCoordArray, y); + GLBuffers.puts(textCoordArray, y); padding(TEXTCOORD, tComps-2); } public void glTexCoord3s(short x, short y, short z) { checkSeal(false); growBufferIfNecessary(TEXTCOORD, 3); if(tComps>0) - BufferUtil.puts(textCoordArray, x); + GLBuffers.puts(textCoordArray, x); if(tComps>1) - BufferUtil.puts(textCoordArray, y); + GLBuffers.puts(textCoordArray, y); if(tComps>2) - BufferUtil.puts(textCoordArray, z); + GLBuffers.puts(textCoordArray, z); padding(TEXTCOORD, tComps-3); } public void glTexCoord2f(float x, float y) { checkSeal(false); growBufferIfNecessary(TEXTCOORD, 2); if(tComps>0) - BufferUtil.putf(textCoordArray, x); + GLBuffers.putf(textCoordArray, x); if(tComps>1) - BufferUtil.putf(textCoordArray, y); + GLBuffers.putf(textCoordArray, y); padding(TEXTCOORD, tComps-2); } public void glTexCoord3f(float x, float y, float z) { checkSeal(false); growBufferIfNecessary(TEXTCOORD, 3); if(tComps>0) - BufferUtil.putf(textCoordArray, x); + GLBuffers.putf(textCoordArray, x); if(tComps>1) - BufferUtil.putf(textCoordArray, y); + GLBuffers.putf(textCoordArray, y); if(tComps>2) - BufferUtil.putf(textCoordArray, z); + GLBuffers.putf(textCoordArray, z); padding(TEXTCOORD, tComps-3); } @@ -746,7 +746,7 @@ public class ImmModeSink { public void enableBufferGLSL(GL gl, boolean enable) { GL2ES2 glsl = gl.getGL2ES2(); - com.sun.opengl.util.glsl.ShaderState st = com.sun.opengl.util.glsl.ShaderState.getCurrent(); + com.jogamp.opengl.util.glsl.ShaderState st = com.jogamp.opengl.util.glsl.ShaderState.getCurrent(); if(null==st) { throw new GLException("No ShaderState current"); } @@ -809,20 +809,20 @@ public class ImmModeSink { // non public matters protected void allocateBuffer(int elements) { - int vWidth = vComps * BufferUtil.sizeOfGLType(vDataType); - int cWidth = cComps * BufferUtil.sizeOfGLType(cDataType); - int nWidth = nComps * BufferUtil.sizeOfGLType(nDataType); - int tWidth = tComps * BufferUtil.sizeOfGLType(tDataType); + int vWidth = vComps * GLBuffers.sizeOfGLType(vDataType); + int cWidth = cComps * GLBuffers.sizeOfGLType(cDataType); + int nWidth = nComps * GLBuffers.sizeOfGLType(nDataType); + int tWidth = tComps * GLBuffers.sizeOfGLType(tDataType); count = elements; bSize = count * ( vWidth + cWidth + nWidth + tWidth ) ; - buffer = BufferUtil.newByteBuffer(bSize); + buffer = GLBuffers.newDirectByteBuffer(bSize); int pos = 0; int size= count * vWidth ; if(size>0) { - vertexArray = BufferUtil.sliceGLBuffer(buffer, pos, size, vDataType); + vertexArray = GLBuffers.sliceGLBuffer(buffer, pos, size, vDataType); } else { vertexArray = null; } @@ -831,7 +831,7 @@ public class ImmModeSink { size= count * cWidth ; if(size>0) { - colorArray = BufferUtil.sliceGLBuffer(buffer, pos, size, cDataType); + colorArray = GLBuffers.sliceGLBuffer(buffer, pos, size, cDataType); } else { colorArray = null; } @@ -840,7 +840,7 @@ public class ImmModeSink { size= count * nWidth ; if(size>0) { - normalArray = BufferUtil.sliceGLBuffer(buffer, pos, size, nDataType); + normalArray = GLBuffers.sliceGLBuffer(buffer, pos, size, nDataType); } else { normalArray = null; } @@ -849,7 +849,7 @@ public class ImmModeSink { size= count * tWidth ; if(size>0) { - textCoordArray = BufferUtil.sliceGLBuffer(buffer, pos, size, tDataType); + textCoordArray = GLBuffers.sliceGLBuffer(buffer, pos, size, tDataType); } else { textCoordArray = null; } @@ -905,19 +905,19 @@ public class ImmModeSink { if(null!=_vertexArray) { _vertexArray.flip(); - BufferUtil.put(vertexArray, _vertexArray); + GLBuffers.put(vertexArray, _vertexArray); } if(null!=_colorArray) { _colorArray.flip(); - BufferUtil.put(colorArray, _colorArray); + GLBuffers.put(colorArray, _colorArray); } if(null!=_normalArray) { _normalArray.flip(); - BufferUtil.put(normalArray, _normalArray); + GLBuffers.put(normalArray, _normalArray); } if(null!=_textCoordArray) { _textCoordArray.flip(); - BufferUtil.put(textCoordArray, _textCoordArray); + GLBuffers.put(textCoordArray, _textCoordArray); } } @@ -944,7 +944,7 @@ public class ImmModeSink { if ( null==dest ) return; while((fill--)>0) { - BufferUtil.putb(dest, (byte)0); + GLBuffers.putb(dest, (byte)0); } } diff --git a/src/jogl/classes/com/sun/opengl/util/Locator.java b/src/jogl/classes/com/jogamp/opengl/util/Locator.java index 06cd50ce8..c524c0888 100644 --- a/src/jogl/classes/com/sun/opengl/util/Locator.java +++ b/src/jogl/classes/com/jogamp/opengl/util/Locator.java @@ -31,7 +31,7 @@ * */ -package com.sun.opengl.util; +package com.jogamp.opengl.util; import java.util.*; import java.nio.*; diff --git a/src/jogl/classes/com/sun/opengl/util/PMVMatrix.java b/src/jogl/classes/com/jogamp/opengl/util/PMVMatrix.java index 4211e893b..47de8ce0a 100755 --- a/src/jogl/classes/com/sun/opengl/util/PMVMatrix.java +++ b/src/jogl/classes/com/jogamp/opengl/util/PMVMatrix.java @@ -31,9 +31,10 @@ * */ -package com.sun.opengl.util; +package com.jogamp.opengl.util; -import com.sun.opengl.impl.ProjectFloat; +import com.jogamp.common.nio.Buffers; +import com.jogamp.opengl.impl.ProjectFloat; import java.nio.*; import java.util.ArrayList; @@ -47,7 +48,7 @@ public class PMVMatrix implements GLMatrixFunc { public PMVMatrix() { projectFloat = new ProjectFloat(); - matrixIdent = BufferUtil.newFloatBuffer(1*16); + matrixIdent = Buffers.newDirectFloatBuffer(1*16); projectFloat.gluMakeIdentityf(matrixIdent); matrixIdent.rewind(); @@ -57,7 +58,7 @@ public class PMVMatrix implements GLMatrixFunc { // Mvi Modelview-Inverse // Mvit Modelview-Inverse-Transpose // Pmv P * Mv - matrixTPMvMvitPmv = BufferUtil.newFloatBuffer(6*16); // grouping T + P + Mv + Mvi + Mvit + Pmv + matrixTPMvMvitPmv = Buffers.newDirectFloatBuffer(6*16); // grouping T + P + Mv + Mvi + Mvit + Pmv matrixPMvMvitPmv = slice(matrixTPMvMvitPmv, 1*16, 5*16); // grouping P + Mv + Mvi + Mvit + Pmv matrixT = slice(matrixTPMvMvitPmv, 0*16, 1*16); // T matrixPMvMvit = slice(matrixTPMvMvitPmv, 1*16, 4*16); // grouping P + Mv + Mvi + Mvit @@ -70,9 +71,9 @@ public class PMVMatrix implements GLMatrixFunc { matrixPmv = slice(matrixTPMvMvitPmv, 5*16, 1*16); // Pmv matrixTPMvMvitPmv.rewind(); - matrixMvit3 = BufferUtil.newFloatBuffer(3*3); + matrixMvit3 = Buffers.newDirectFloatBuffer(3*3); - localBuf = BufferUtil.newFloatBuffer(6*16); + localBuf = Buffers.newDirectFloatBuffer(6*16); matrixMult=slice(localBuf, 0*16, 16); @@ -294,7 +295,7 @@ public class PMVMatrix implements GLMatrixFunc { } /** - * @param pname GL_MODELVIEW, GL_PROJECTION or GL.GL_TEXTURE + * @param matrixName GL_MODELVIEW, GL_PROJECTION or GL.GL_TEXTURE * @return the given matrix */ public final FloatBuffer glGetMatrixf(final int matrixName) { diff --git a/src/jogl/classes/com/sun/opengl/util/StreamUtil.java b/src/jogl/classes/com/jogamp/opengl/util/StreamUtil.java index 8ad731743..4cf8cb1f0 100755 --- a/src/jogl/classes/com/sun/opengl/util/StreamUtil.java +++ b/src/jogl/classes/com/jogamp/opengl/util/StreamUtil.java @@ -37,7 +37,7 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.util; +package com.jogamp.opengl.util; import java.io.*; import java.nio.*; @@ -59,7 +59,7 @@ public class StreamUtil { public static ByteBuffer readAll2Buffer(InputStream stream) throws IOException { BytesRead bytesRead = readAllImpl(stream); - return BufferUtil.newByteBuffer(bytesRead.data, 0, bytesRead.payloadLen); + return GLBuffers.newDirectByteBuffer(bytesRead.data, 0, bytesRead.payloadLen); } private static BytesRead readAllImpl(InputStream stream) throws IOException { diff --git a/src/jogl/classes/com/sun/opengl/util/TGAWriter.java b/src/jogl/classes/com/jogamp/opengl/util/TGAWriter.java index c5b1041a0..b949f0e39 100755 --- a/src/jogl/classes/com/sun/opengl/util/TGAWriter.java +++ b/src/jogl/classes/com/jogamp/opengl/util/TGAWriter.java @@ -34,7 +34,7 @@ * facility. */ -package com.sun.opengl.util; +package com.jogamp.opengl.util; import java.io.*; import java.nio.*; @@ -42,13 +42,11 @@ import java.nio.channels.*; /** * Utility class which helps take fast screenshots of OpenGL rendering - * results into Targa-format files. Used by the {@link - * com.sun.opengl.util.gl2.Screenshot Screenshot} class; can also be used - * in conjunction with the {@link com.sun.opengl.util.gl2.TileRenderer - * TileRenderer} class. <P> + * results into Targa-format files. Used by the {@link com.jogamp.opengl.util.awt.Screenshot} + * class; can also be used in conjunction with the {@link com.jogamp.opengl.util.gl2.TileRenderer} class. */ - public class TGAWriter { + private static final int TARGA_HEADER_SIZE = 18; private FileChannel ch; diff --git a/src/jogl/classes/com/sun/opengl/util/awt/ImageUtil.java b/src/jogl/classes/com/jogamp/opengl/util/awt/ImageUtil.java index 534ab444d..a3139b16a 100755 --- a/src/jogl/classes/com/sun/opengl/util/awt/ImageUtil.java +++ b/src/jogl/classes/com/jogamp/opengl/util/awt/ImageUtil.java @@ -37,7 +37,7 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.util.awt; +package com.jogamp.opengl.util.awt; import java.awt.*; import java.awt.image.*; diff --git a/src/jogl/classes/com/sun/opengl/util/awt/Overlay.java b/src/jogl/classes/com/jogamp/opengl/util/awt/Overlay.java index 5a54a7161..1275c9391 100755 --- a/src/jogl/classes/com/sun/opengl/util/awt/Overlay.java +++ b/src/jogl/classes/com/jogamp/opengl/util/awt/Overlay.java @@ -37,12 +37,12 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.util.awt; +package com.jogamp.opengl.util.awt; import java.awt.Graphics2D; import javax.media.opengl.*; -import com.sun.opengl.util.texture.*; +import com.jogamp.opengl.util.texture.*; /** Provides a Java 2D overlay on top of an arbitrary GLDrawable, making it easier to do things like draw text and images on top of diff --git a/src/jogl/classes/com/sun/opengl/util/awt/Screenshot.java b/src/jogl/classes/com/jogamp/opengl/util/awt/Screenshot.java index 55099445a..7019d720f 100755 --- a/src/jogl/classes/com/sun/opengl/util/awt/Screenshot.java +++ b/src/jogl/classes/com/jogamp/opengl/util/awt/Screenshot.java @@ -34,7 +34,7 @@ * facility. */ -package com.sun.opengl.util.awt; +package com.jogamp.opengl.util.awt; import java.awt.image.*; import java.io.*; @@ -46,7 +46,7 @@ import javax.media.opengl.*; import javax.media.opengl.glu.*; import javax.media.opengl.glu.gl2.*; -import com.sun.opengl.util.*; +import com.jogamp.opengl.util.*; /** Utilities for taking screenshots of OpenGL applications. */ diff --git a/src/jogl/classes/com/sun/opengl/util/awt/TextRenderer.java b/src/jogl/classes/com/jogamp/opengl/util/awt/TextRenderer.java index 059ead63d..bac9f88ea 100755 --- a/src/jogl/classes/com/sun/opengl/util/awt/TextRenderer.java +++ b/src/jogl/classes/com/jogamp/opengl/util/awt/TextRenderer.java @@ -36,13 +36,14 @@ * Sun gratefully acknowledges that this software was originally authored * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.util.awt; +package com.jogamp.opengl.util.awt; -import com.sun.opengl.impl.Debug; -import com.sun.opengl.util.*; -import com.sun.opengl.util.packrect.*; -import com.sun.opengl.util.texture.*; -import com.sun.opengl.util.texture.awt.*; +import com.jogamp.common.nio.Buffers; +import com.jogamp.opengl.impl.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; @@ -114,7 +115,7 @@ import javax.media.opengl.awt.*; pack both glyphs and full Strings' rendering results (which are variable size) onto a larger OpenGL texture. The internal backing store is maintained using a {@link - com.sun.opengl.util.awt.TextureRenderer TextureRenderer}. A least + com.jogamp.opengl.util.awt.TextureRenderer TextureRenderer}. A least recently used (LRU) algorithm is used to discard previously rendered strings; the specific algorithm is undefined, but is currently implemented by flushing unused Strings' rendering @@ -442,7 +443,7 @@ public class TextRenderer { one, where each component ranges from 0.0f - 1.0f. The alpha component, if used, does not need to be premultiplied into the color channels as described in the documentation for {@link - com.sun.opengl.util.texture.Texture Texture}, although + com.jogamp.opengl.util.texture.Texture Texture}, although premultiplied colors are used internally. The default color is opaque white. @@ -1707,8 +1708,8 @@ public class TextRenderer { Pipelined_QuadRenderer() { GL2 gl = GLContext.getCurrentGL().getGL2(); - mVertCoords = BufferUtil.newFloatBuffer(kTotalBufferSizeCoordsVerts); - mTexCoords = BufferUtil.newFloatBuffer(kTotalBufferSizeCoordsTex); + mVertCoords = Buffers.newDirectFloatBuffer(kTotalBufferSizeCoordsVerts); + mTexCoords = Buffers.newDirectFloatBuffer(kTotalBufferSizeCoordsTex); usingVBOs = is15Available(gl); diff --git a/src/jogl/classes/com/sun/opengl/util/awt/TextureRenderer.java b/src/jogl/classes/com/jogamp/opengl/util/awt/TextureRenderer.java index 1f6393d39..bc5aa517e 100755 --- a/src/jogl/classes/com/sun/opengl/util/awt/TextureRenderer.java +++ b/src/jogl/classes/com/jogamp/opengl/util/awt/TextureRenderer.java @@ -37,7 +37,7 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.util.awt; +package com.jogamp.opengl.util.awt; import java.awt.Color; import java.awt.Dimension; @@ -49,12 +49,12 @@ import java.awt.image.*; import javax.media.opengl.*; import javax.media.opengl.glu.*; import javax.media.opengl.glu.gl2.*; -import com.sun.opengl.util.texture.*; -import com.sun.opengl.util.texture.spi.*; -import com.sun.opengl.util.texture.awt.*; +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 - com.sun.opengl.util.texture.Texture Texture} using the Java 2D + com.jogamp.opengl.util.texture.Texture Texture} using the Java 2D APIs. This renderer class uses an internal Java 2D image (of unspecified type) for its backing store and flushes portions of that image to an OpenGL texture on demand. The resulting OpenGL @@ -389,7 +389,7 @@ public class TextureRenderer { Each component ranges from 0.0f - 1.0f. The alpha component, if used, does not need to be premultiplied into the color channels as described in the documentation for {@link - com.sun.opengl.util.texture.Texture Texture}, although + com.jogamp.opengl.util.texture.Texture Texture}, although premultiplied colors are used internally. The default color is opaque white. @@ -631,7 +631,7 @@ public class TextureRenderer { // BufferedImage; it's just a reference to the contents but we // need it in order to update sub-regions of the underlying // texture - textureData = new AWTTextureData(internalFormat, 0, mipmap, image); + textureData = new AWTTextureData(gl.getGLProfile(), internalFormat, 0, mipmap, image); // For now, always reallocate the underlying OpenGL texture when // the backing store size changes mustReallocateTexture = true; diff --git a/src/jogl/classes/com/sun/opengl/util/gl2/BitmapCharRec.java b/src/jogl/classes/com/jogamp/opengl/util/gl2/BitmapCharRec.java index 9738be60a..34685e1b2 100644 --- a/src/jogl/classes/com/sun/opengl/util/gl2/BitmapCharRec.java +++ b/src/jogl/classes/com/jogamp/opengl/util/gl2/BitmapCharRec.java @@ -37,7 +37,7 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.util.gl2; +package com.jogamp.opengl.util.gl2; /* Copyright (c) Mark J. Kilgard, 1994, 1998. */ diff --git a/src/jogl/classes/com/sun/opengl/util/gl2/BitmapFontRec.java b/src/jogl/classes/com/jogamp/opengl/util/gl2/BitmapFontRec.java index d110c262b..18f7d3b28 100644 --- a/src/jogl/classes/com/sun/opengl/util/gl2/BitmapFontRec.java +++ b/src/jogl/classes/com/jogamp/opengl/util/gl2/BitmapFontRec.java @@ -37,7 +37,7 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.util.gl2; +package com.jogamp.opengl.util.gl2; /* Copyright (c) Mark J. Kilgard, 1994, 1998. */ diff --git a/src/jogl/classes/com/sun/opengl/util/gl2/CoordRec.java b/src/jogl/classes/com/jogamp/opengl/util/gl2/CoordRec.java index e87354dbf..9ad95ec03 100644 --- a/src/jogl/classes/com/sun/opengl/util/gl2/CoordRec.java +++ b/src/jogl/classes/com/jogamp/opengl/util/gl2/CoordRec.java @@ -37,7 +37,7 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.util.gl2; +package com.jogamp.opengl.util.gl2; /* Copyright (c) Mark J. Kilgard, 1994, 1998. */ diff --git a/src/jogl/classes/com/sun/opengl/util/gl2/GLUT.java b/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUT.java index 5a1f7d12d..8befc13ba 100644 --- a/src/jogl/classes/com/sun/opengl/util/gl2/GLUT.java +++ b/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUT.java @@ -37,7 +37,7 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.util.gl2; +package com.jogamp.opengl.util.gl2; import javax.media.opengl.*; import javax.media.opengl.glu.*; diff --git a/src/jogl/classes/com/sun/opengl/util/gl2/GLUTBitmap8x13.java b/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTBitmap8x13.java index b6e5c425a..07ded652a 100644 --- a/src/jogl/classes/com/sun/opengl/util/gl2/GLUTBitmap8x13.java +++ b/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTBitmap8x13.java @@ -37,7 +37,7 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.util.gl2; +package com.jogamp.opengl.util.gl2; class GLUTBitmap8x13 { diff --git a/src/jogl/classes/com/sun/opengl/util/gl2/GLUTBitmap9x15.java b/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTBitmap9x15.java index bba9a8fc5..5d357f3f7 100644 --- a/src/jogl/classes/com/sun/opengl/util/gl2/GLUTBitmap9x15.java +++ b/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTBitmap9x15.java @@ -37,7 +37,7 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.util.gl2; +package com.jogamp.opengl.util.gl2; class GLUTBitmap9x15 { diff --git a/src/jogl/classes/com/sun/opengl/util/gl2/GLUTBitmapHelvetica10.java b/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTBitmapHelvetica10.java index cca045ffa..b9c7e6e50 100644 --- a/src/jogl/classes/com/sun/opengl/util/gl2/GLUTBitmapHelvetica10.java +++ b/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTBitmapHelvetica10.java @@ -37,7 +37,7 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.util.gl2; +package com.jogamp.opengl.util.gl2; class GLUTBitmapHelvetica10 { diff --git a/src/jogl/classes/com/sun/opengl/util/gl2/GLUTBitmapHelvetica12.java b/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTBitmapHelvetica12.java index b73c82fa9..bc86f6216 100644 --- a/src/jogl/classes/com/sun/opengl/util/gl2/GLUTBitmapHelvetica12.java +++ b/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTBitmapHelvetica12.java @@ -37,7 +37,7 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.util.gl2; +package com.jogamp.opengl.util.gl2; class GLUTBitmapHelvetica12 { diff --git a/src/jogl/classes/com/sun/opengl/util/gl2/GLUTBitmapHelvetica18.java b/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTBitmapHelvetica18.java index cf34a6d25..1b2e69ba4 100644 --- a/src/jogl/classes/com/sun/opengl/util/gl2/GLUTBitmapHelvetica18.java +++ b/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTBitmapHelvetica18.java @@ -37,7 +37,7 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.util.gl2; +package com.jogamp.opengl.util.gl2; class GLUTBitmapHelvetica18 { diff --git a/src/jogl/classes/com/sun/opengl/util/gl2/GLUTBitmapTimesRoman10.java b/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTBitmapTimesRoman10.java index 32699863f..f753b56f7 100644 --- a/src/jogl/classes/com/sun/opengl/util/gl2/GLUTBitmapTimesRoman10.java +++ b/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTBitmapTimesRoman10.java @@ -37,7 +37,7 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.util.gl2; +package com.jogamp.opengl.util.gl2; class GLUTBitmapTimesRoman10 { diff --git a/src/jogl/classes/com/sun/opengl/util/gl2/GLUTBitmapTimesRoman24.java b/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTBitmapTimesRoman24.java index 36fb76c66..073e6e673 100644 --- a/src/jogl/classes/com/sun/opengl/util/gl2/GLUTBitmapTimesRoman24.java +++ b/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTBitmapTimesRoman24.java @@ -37,7 +37,7 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.util.gl2; +package com.jogamp.opengl.util.gl2; class GLUTBitmapTimesRoman24 { diff --git a/src/jogl/classes/com/sun/opengl/util/gl2/GLUTStrokeMonoRoman.java b/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTStrokeMonoRoman.java index 79e4b70f8..b8296924e 100644 --- a/src/jogl/classes/com/sun/opengl/util/gl2/GLUTStrokeMonoRoman.java +++ b/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTStrokeMonoRoman.java @@ -37,7 +37,7 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.util.gl2; +package com.jogamp.opengl.util.gl2; class GLUTStrokeMonoRoman { diff --git a/src/jogl/classes/com/sun/opengl/util/gl2/GLUTStrokeRoman.java b/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTStrokeRoman.java index e960f155a..94fa1c4fd 100644 --- a/src/jogl/classes/com/sun/opengl/util/gl2/GLUTStrokeRoman.java +++ b/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTStrokeRoman.java @@ -37,7 +37,7 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.util.gl2; +package com.jogamp.opengl.util.gl2; class GLUTStrokeRoman { diff --git a/src/jogl/classes/com/sun/opengl/util/gl2/StrokeCharRec.java b/src/jogl/classes/com/jogamp/opengl/util/gl2/StrokeCharRec.java index 1d5d3de63..af3d538ae 100644 --- a/src/jogl/classes/com/sun/opengl/util/gl2/StrokeCharRec.java +++ b/src/jogl/classes/com/jogamp/opengl/util/gl2/StrokeCharRec.java @@ -37,7 +37,7 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.util.gl2; +package com.jogamp.opengl.util.gl2; /* Copyright (c) Mark J. Kilgard, 1994, 1998. */ diff --git a/src/jogl/classes/com/sun/opengl/util/gl2/StrokeFontRec.java b/src/jogl/classes/com/jogamp/opengl/util/gl2/StrokeFontRec.java index 0e6133a2d..d3195f24d 100644 --- a/src/jogl/classes/com/sun/opengl/util/gl2/StrokeFontRec.java +++ b/src/jogl/classes/com/jogamp/opengl/util/gl2/StrokeFontRec.java @@ -37,7 +37,7 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.util.gl2; +package com.jogamp.opengl.util.gl2; /* Copyright (c) Mark J. Kilgard, 1994, 1998. */ diff --git a/src/jogl/classes/com/sun/opengl/util/gl2/StrokeRec.java b/src/jogl/classes/com/jogamp/opengl/util/gl2/StrokeRec.java index 91241ebc0..8796e8b08 100644 --- a/src/jogl/classes/com/sun/opengl/util/gl2/StrokeRec.java +++ b/src/jogl/classes/com/jogamp/opengl/util/gl2/StrokeRec.java @@ -37,7 +37,7 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.util.gl2; +package com.jogamp.opengl.util.gl2; /* Copyright (c) Mark J. Kilgard, 1994, 1998. */ diff --git a/src/jogl/classes/com/sun/opengl/util/gl2/TileRenderer.java b/src/jogl/classes/com/jogamp/opengl/util/gl2/TileRenderer.java index a446b0928..714c134d4 100755 --- a/src/jogl/classes/com/sun/opengl/util/gl2/TileRenderer.java +++ b/src/jogl/classes/com/jogamp/opengl/util/gl2/TileRenderer.java @@ -1,4 +1,4 @@ -package com.sun.opengl.util.gl2; +package com.jogamp.opengl.util.gl2; import java.awt.Dimension; import java.nio.Buffer; diff --git a/src/jogl/classes/com/sun/opengl/util/glsl/GLSLArrayHandler.java b/src/jogl/classes/com/jogamp/opengl/util/glsl/GLSLArrayHandler.java index 1ef9874e4..1119aa5ab 100644 --- a/src/jogl/classes/com/sun/opengl/util/glsl/GLSLArrayHandler.java +++ b/src/jogl/classes/com/jogamp/opengl/util/glsl/GLSLArrayHandler.java @@ -1,10 +1,10 @@ -package com.sun.opengl.util.glsl; +package com.jogamp.opengl.util.glsl; import javax.media.opengl.*; import javax.media.opengl.fixedfunc.*; -import com.sun.opengl.util.*; -import com.sun.opengl.util.glsl.ShaderState; +import com.jogamp.opengl.util.*; +import com.jogamp.opengl.util.glsl.ShaderState; import java.nio.*; public class GLSLArrayHandler implements GLArrayHandler { diff --git a/src/jogl/classes/com/sun/opengl/util/glsl/ShaderCode.java b/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderCode.java index 606d2e1b5..d0e7ea29d 100644 --- a/src/jogl/classes/com/sun/opengl/util/glsl/ShaderCode.java +++ b/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderCode.java @@ -1,9 +1,10 @@ -package com.sun.opengl.util.glsl; +package com.jogamp.opengl.util.glsl; +import com.jogamp.common.nio.Buffers; import javax.media.opengl.*; -import com.sun.opengl.util.*; -import com.sun.opengl.impl.Debug; +import com.jogamp.opengl.util.*; +import com.jogamp.opengl.impl.Debug; import java.util.*; import java.nio.*; @@ -34,7 +35,7 @@ public class ShaderCode { shaderBinaryFormat = -1; shaderBinary = null; shaderType = type; - shader = BufferUtil.newIntBuffer(number); + shader = Buffers.newDirectIntBuffer(number); id = getNextID(); if(DEBUG_CODE) { @@ -55,7 +56,7 @@ public class ShaderCode { shaderBinaryFormat = binFormat; shaderBinary = binary; shaderType = type; - shader = BufferUtil.newIntBuffer(number); + shader = Buffers.newDirectIntBuffer(number); id = getNextID(); } diff --git a/src/jogl/classes/com/sun/opengl/util/glsl/ShaderProgram.java b/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderProgram.java index c06eae383..430ed08ce 100644 --- a/src/jogl/classes/com/sun/opengl/util/glsl/ShaderProgram.java +++ b/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderProgram.java @@ -1,11 +1,10 @@ -package com.sun.opengl.util.glsl; +package com.jogamp.opengl.util.glsl; import javax.media.opengl.*; import java.util.HashMap; import java.util.Iterator; -import java.nio.*; import java.io.PrintStream; public class ShaderProgram { @@ -104,16 +103,20 @@ public class ShaderProgram { * Refetches all previously bin/get attribute names * and resets all attribute data as well * - * @see getAttribLocation * @param gl * @param oldShaderID the to be replace Shader * @param newShader the new ShaderCode * @param verboseOut the optional verbose outputstream * @throws GLException is the program is not linked * - * @see #glRefetchAttribLocations - * @see #glResetAllVertexAttributes - * @see #glReplaceShader + * @see ShaderState#glEnableVertexAttribArray + * @see ShaderState#glDisableVertexAttribArray + * @see ShaderState#glVertexAttribPointer + * @see ShaderState#getVertexAttribPointer + * @see ShaderState#glReleaseAllVertexAttributes + * @see ShaderState#glResetAllVertexAttributes + * @see ShaderState#glResetAllVertexAttributes + * @see ShaderState#glResetAllVertexAttributes */ public synchronized boolean glReplaceShader(GL2ES2 gl, int oldShaderID, ShaderCode newShader, PrintStream verboseOut) { if(!programLinked) throw new GLException("Program is not linked"); diff --git a/src/jogl/classes/com/sun/opengl/util/glsl/ShaderState.java b/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderState.java index 8712ac7e2..86f9251b7 100644 --- a/src/jogl/classes/com/sun/opengl/util/glsl/ShaderState.java +++ b/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderState.java @@ -1,15 +1,12 @@ -package com.sun.opengl.util.glsl; +package com.jogamp.opengl.util.glsl; import javax.media.opengl.*; -import com.sun.opengl.util.*; -import com.sun.opengl.impl.Debug; +import com.jogamp.opengl.impl.Debug; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; -import java.nio.*; -import java.io.PrintStream; import java.security.*; public class ShaderState { @@ -25,8 +22,8 @@ public class ShaderState { /** * Fetches the current shader state from the thread local storage (TLS) * - * @see javax.media.opengl.glsl.ShaderState#glUseProgram(GL2ES2, boolean) - * @see javax.media.opengl.glsl.ShaderState#getCurrent() + * @see com.jogamp.opengl.util.glsl.ShaderState#glUseProgram(GL2ES2, boolean) + * @see com.jogamp.opengl.util.glsl.ShaderState#getCurrent() */ public static synchronized ShaderState getCurrent() { GLContext current = GLContext.getCurrent(); @@ -41,8 +38,8 @@ public class ShaderState { * Puts this ShaderState to to the thread local storage (TLS), * if <code>on</code> is <code>true</code>. * - * @see javax.media.opengl.glsl.ShaderState#glUseProgram(GL2ES2, boolean) - * @see javax.media.opengl.glsl.ShaderState#getCurrent() + * @see com.jogamp.opengl.util.glsl.ShaderState#glUseProgram(GL2ES2, boolean) + * @see com.jogamp.opengl.util.glsl.ShaderState#getCurrent() */ public synchronized void glUseProgram(GL2ES2 gl, boolean on) { if(on) { @@ -178,7 +175,7 @@ public class ShaderState { * @see #glGetAttribLocation * @see javax.media.opengl.GL2ES2#glGetAttribLocation * @see #getAttribLocation - * @see #glReplaceShader + * @see ShaderProgram#glReplaceShader */ public void glBindAttribLocation(GL2ES2 gl, int index, String name) { if(null==shaderProgram) throw new GLException("No program is attached"); @@ -203,7 +200,7 @@ public class ShaderState { * @see #glGetAttribLocation * @see javax.media.opengl.GL2ES2#glGetAttribLocation * @see #getAttribLocation - * @see #glReplaceShader + * @see ShaderProgram#glReplaceShader */ public int glGetAttribLocation(GL2ES2 gl, String name) { if(!shaderProgram.linked()) throw new GLException("Program is not linked"); @@ -240,17 +237,17 @@ public class ShaderState { * Even if the attribute is not found in the current shader, * it is stored in this state. * - * @returns false, if the name is not found, otherwise true + * @return false, if the name is not found, otherwise true * * @throws GLException if the program is not in use * * @see #glEnableVertexAttribArray * @see #glDisableVertexAttribArray * @see #glVertexAttribPointer - * @see #getVertexAttributePointer + * @see #getVertexAttribPointer * @see #glReleaseAllVertexAttributes * @see #glResetAllVertexAttributes - * @see #glReplaceShader + * @see ShaderProgram#glReplaceShader */ public boolean glEnableVertexAttribArray(GL2ES2 gl, String name) { if(!shaderProgram.inUse()) throw new GLException("Program is not in use"); @@ -281,17 +278,17 @@ public class ShaderState { * Even if the attribute is not found in the current shader, * it is removed from this state. * - * @returns false, if the name is not found, otherwise true + * @return false, if the name is not found, otherwise true * * @throws GLException if the program is not in use * * @see #glEnableVertexAttribArray * @see #glDisableVertexAttribArray * @see #glVertexAttribPointer - * @see #getVertexAttributePointer + * @see #getVertexAttribPointer * @see #glReleaseAllVertexAttributes * @see #glResetAllVertexAttributes - * @see #glReplaceShader + * @see ShaderProgram#glReplaceShader */ public boolean glDisableVertexAttribArray(GL2ES2 gl, String name) { if(!shaderProgram.inUse()) throw new GLException("Program is not in use"); @@ -322,17 +319,17 @@ public class ShaderState { * it's index will be set with the attribute's location, * if found. * - * @returns false, if the name is not found, otherwise true + * @return false, if the name is not found, otherwise true * * @throws GLException if the program is not in use * * @see #glEnableVertexAttribArray * @see #glDisableVertexAttribArray * @see #glVertexAttribPointer - * @see #getVertexAttributePointer + * @see #getVertexAttribPointer * @see #glReleaseAllVertexAttributes * @see #glResetAllVertexAttributes - * @see #glReplaceShader + * @see ShaderProgram#glReplaceShader */ public boolean glVertexAttribPointer(GL2ES2 gl, GLArrayData data) { if(!shaderProgram.inUse()) throw new GLException("Program is not in use"); @@ -367,15 +364,15 @@ public class ShaderState { /** * Get the vertex attribute data, previously set. * - * @returns the GLArrayData object, null if not previously set. + * @return the GLArrayData object, null if not previously set. * * @see #glEnableVertexAttribArray * @see #glDisableVertexAttribArray * @see #glVertexAttribPointer - * @see #getVertexAttributePointer + * @see #getVertexAttribPointer * @see #glReleaseAllVertexAttributes * @see #glResetAllVertexAttributes - * @see #glReplaceShader + * @see ShaderProgram#glReplaceShader */ public GLArrayData getVertexAttribPointer(String name) { return (GLArrayData) vertexAttribMap2Data.get(name); @@ -390,11 +387,11 @@ public class ShaderState { * @see #glEnableVertexAttribArray * @see #glDisableVertexAttribArray * @see #glVertexAttribPointer - * @see #getVertexAttributePointer + * @see #getVertexAttribPointer * @see #glReleaseAllVertexAttributes * @see #glResetAllVertexAttributes * @see #glResetAllVertexAttributes - * @see #glReplaceShader + * @see ShaderProgram#glReplaceShader */ public void glReleaseAllVertexAttributes(GL2ES2 gl) { if(null!=shaderProgram) { @@ -428,11 +425,11 @@ public class ShaderState { * @see #glEnableVertexAttribArray * @see #glDisableVertexAttribArray * @see #glVertexAttribPointer - * @see #getVertexAttributePointer + * @see #getVertexAttribPointer * @see #glReleaseAllVertexAttributes * @see #glResetAllVertexAttributes * @see #glResetAllVertexAttributes - * @see #glReplaceShader + * @see ShaderProgram#glReplaceShader */ public void glDisableAllVertexAttributeArrays(GL2ES2 gl, boolean removeFromState) { if(!shaderProgram.inUse()) throw new GLException("Program is not in use"); @@ -458,10 +455,10 @@ public class ShaderState { * @see #glEnableVertexAttribArray * @see #glDisableVertexAttribArray * @see #glVertexAttribPointer - * @see #getVertexAttributePointer + * @see #getVertexAttribPointer * @see #glReleaseAllVertexAttributes * @see #glResetAllVertexAttributes - * @see #glReplaceShader + * @see ShaderProgram#glReplaceShader */ public void glResetAllVertexAttributes(GL2ES2 gl) { if(!shaderProgram.inUse()) throw new GLException("Program is not in use"); @@ -520,7 +517,7 @@ public class ShaderState { * @see #glGetUniformLocation * @see javax.media.opengl.GL2ES2#glGetUniformLocation * @see #getUniformLocation - * @see #glReplaceShader + * @see ShaderProgram#glReplaceShader */ protected int glGetUniformLocation(GL2ES2 gl, String name) { if(!shaderProgram.inUse()) throw new GLException("Program is not in use"); @@ -554,14 +551,14 @@ public class ShaderState { * if found. * * - * @returns false, if the name is not found, otherwise true + * @return false, if the name is not found, otherwise true * * @throws GLException if the program is not in use * * @see #glGetUniformLocation * @see javax.media.opengl.GL2ES2#glGetUniformLocation * @see #getUniformLocation - * @see #glReplaceShader + * @see ShaderProgram#glReplaceShader */ public boolean glUniform(GL2ES2 gl, GLUniformData data) { if(!shaderProgram.inUse()) throw new GLException("Program is not in use"); @@ -581,7 +578,7 @@ public class ShaderState { /** * Get the uniform data, previously set. * - * @returns the GLUniformData object, null if not previously set. + * @return the GLUniformData object, null if not previously set. */ public GLUniformData getUniform(String name) { return (GLUniformData) uniformMap2Data.get(name); diff --git a/src/jogl/classes/com/sun/opengl/util/glsl/ShaderUtil.java b/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderUtil.java index 390fb27c7..c7e845953 100644 --- a/src/jogl/classes/com/sun/opengl/util/glsl/ShaderUtil.java +++ b/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderUtil.java @@ -31,7 +31,7 @@ * */ -package com.sun.opengl.util.glsl; +package com.jogamp.opengl.util.glsl; import java.io.PrintStream; import java.nio.*; @@ -221,7 +221,7 @@ public class ShaderUtil { v = true; } shaderCompilerAvailable = new Boolean(v); - } else if( gl.isGL2() || gl.isGL2ES2() ) { + } else if( gl.isGL2ES2() ) { shaderCompilerAvailable = new Boolean(true); } else { throw new GLException("Invalid OpenGL profile"); diff --git a/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/FixedFuncUtil.java b/src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/FixedFuncUtil.java index 4149aec69..7ec4ac50e 100644 --- a/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/FixedFuncUtil.java +++ b/src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/FixedFuncUtil.java @@ -2,12 +2,12 @@ * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. */ -package com.sun.opengl.util.glsl.fixedfunc; +package com.jogamp.opengl.util.glsl.fixedfunc; import javax.media.opengl.*; import javax.media.opengl.fixedfunc.*; -import com.sun.opengl.util.glsl.fixedfunc.impl.*; +import com.jogamp.opengl.util.glsl.fixedfunc.impl.*; /** * Tool to pipeline GL2ES2 into a fixed function emulation implementing GL2ES1. @@ -28,7 +28,7 @@ public class FixedFuncUtil { gl.getContext().setGL(impl); return impl; } - throw new GLException("GL Object is neither GL2ES1 nor GL2ES2"); + throw new GLException("GL Object is neither GL2ES1 nor GL2ES2: "+gl.getContext()); } /** @@ -66,25 +66,25 @@ public class FixedFuncUtil { /** * String name for - * @see javax.media.opengl.GL#GL_VERTEX_ARRAY + * @see javax.media.opengl.GL2#GL_VERTEX_ARRAY */ public static final String mgl_Vertex = FixedFuncPipeline.mgl_Vertex; /** * String name for - * @see javax.media.opengl.GL#GL_NORMAL_ARRAY + * @see javax.media.opengl.GL2#GL_NORMAL_ARRAY */ public static final String mgl_Normal = FixedFuncPipeline.mgl_Normal; /** * String name for - * @see javax.media.opengl.GL#GL_COLOR_ARRAY + * @see javax.media.opengl.GL2#GL_COLOR_ARRAY */ public static final String mgl_Color = FixedFuncPipeline.mgl_Color; /** * String name for - * @see javax.media.opengl.GL#GL_TEXTURE_COORD_ARRAY + * @see javax.media.opengl.GL2#GL_TEXTURE_COORD_ARRAY */ public static final String mgl_MultiTexCoord = FixedFuncPipeline.mgl_MultiTexCoord; } diff --git a/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/FixedFuncHook.java b/src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/impl/FixedFuncHook.java index 6f44f10b7..b8e3922a4 100755 --- a/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/FixedFuncHook.java +++ b/src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/impl/FixedFuncHook.java @@ -2,14 +2,14 @@ * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. */ -package com.sun.opengl.util.glsl.fixedfunc.impl; +package com.jogamp.opengl.util.glsl.fixedfunc.impl; import javax.media.opengl.*; import javax.media.opengl.fixedfunc.*; import javax.media.opengl.glu.*; -import com.sun.gluegen.runtime.BufferFactory; -import com.sun.opengl.util.*; -import com.sun.opengl.util.glsl.*; +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 { @@ -128,7 +128,7 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun pmvMatrix.glLoadMatrixf(m); } public void glLoadMatrixf(float[] m, int m_offset) { - glLoadMatrixf(BufferUtil.newFloatBuffer(m, m_offset)); + glLoadMatrixf(GLBuffers.newDirectFloatBuffer(m, m_offset)); } public void glPopMatrix() { pmvMatrix.glPopMatrix(); @@ -143,7 +143,7 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun pmvMatrix.glMultMatrixf(m); } public void glMultMatrixf(float[] m, int m_offset) { - glMultMatrixf(BufferUtil.newFloatBuffer(m, m_offset)); + glMultMatrixf(GLBuffers.newDirectFloatBuffer(m, m_offset)); } public void glTranslatef(float x, float y, float z) { pmvMatrix.glTranslatef(x, y, z); @@ -165,23 +165,23 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun // LightingIf // public void glColor4f(float red, float green, float blue, float alpha) { - fixedFunction.glColor4fv(gl, BufferUtil.newFloatBuffer(new float[] { red, green, blue, 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, BufferUtil.newFloatBuffer(params, 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, BufferUtil.newFloatBuffer(params, params_offset)); + glMaterialfv(face, pname, GLBuffers.newDirectFloatBuffer(params, params_offset)); } public void glMaterialf(int face, int pname, float param) { - glMaterialfv(face, pname, BufferUtil.newFloatBuffer(new float[] { param })); + glMaterialfv(face, pname, GLBuffers.newDirectFloatBuffer(new float[] { param })); } public void glShadeModel(int mode) { fixedFunction.glShadeModel(gl, mode); @@ -206,8 +206,8 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun if(gl.glIsVBOArrayEnabled()) { throw new GLException("VBO array is not disabled: "+array); } - BufferFactory.rangeCheck(array.getBuffer(), 1); - if (!BufferFactory.isDirect(array.getBuffer())) { + Buffers.rangeCheck(array.getBuffer(), 1); + if (!Buffers.isDirect(array.getBuffer())) { throw new GLException("Argument \"pointer\" was not a direct buffer"); } } fixedFunction.glVertexPointer(gl, array); @@ -234,8 +234,8 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun if(gl.glIsVBOArrayEnabled()) { throw new GLException("VBO array is not disabled: "+array); } - BufferFactory.rangeCheck(array.getBuffer(), 1); - if (!BufferFactory.isDirect(array.getBuffer())) { + Buffers.rangeCheck(array.getBuffer(), 1); + if (!Buffers.isDirect(array.getBuffer())) { throw new GLException("Argument \"pointer\" was not a direct buffer"); } } fixedFunction.glColorPointer(gl, array); @@ -265,8 +265,8 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun if(gl.glIsVBOArrayEnabled()) { throw new GLException("VBO array is not disabled: "+array); } - BufferFactory.rangeCheck(array.getBuffer(), 1); - if (!BufferFactory.isDirect(array.getBuffer())) { + Buffers.rangeCheck(array.getBuffer(), 1); + if (!Buffers.isDirect(array.getBuffer())) { throw new GLException("Argument \"pointer\" was not a direct buffer"); } } fixedFunction.glNormalPointer(gl, array); @@ -293,8 +293,8 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun if(gl.glIsVBOArrayEnabled()) { throw new GLException("VBO array is not disabled: "+array); } - BufferFactory.rangeCheck(array.getBuffer(), 1); - if (!BufferFactory.isDirect(array.getBuffer())) { + Buffers.rangeCheck(array.getBuffer(), 1); + if (!Buffers.isDirect(array.getBuffer())) { throw new GLException("Argument \"pointer\" was not a direct buffer"); } } fixedFunction.glTexCoordPointer(gl, array); diff --git a/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/FixedFuncPipeline.java b/src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/impl/FixedFuncPipeline.java index 1b8dd1f11..529e4567b 100644 --- a/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/FixedFuncPipeline.java +++ b/src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/impl/FixedFuncPipeline.java @@ -1,11 +1,11 @@ -package com.sun.opengl.util.glsl.fixedfunc.impl; +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.sun.opengl.util.*; -import com.sun.opengl.util.glsl.*; -import com.sun.opengl.util.glsl.fixedfunc.*; +import com.jogamp.opengl.util.*; +import com.jogamp.opengl.util.glsl.*; import java.nio.*; public class FixedFuncPipeline { @@ -490,14 +490,14 @@ public class FixedFuncPipeline { protected boolean verbose=false; protected boolean textureEnabled=false; - protected IntBuffer textureCoordsEnabled = BufferUtil.newIntBuffer(new int[] { 0, 0, 0, 0, 0, 0, 0, 0 }); + 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 = BufferUtil.newIntBuffer(new int[] { 0, 0, 0, 0, 0, 0, 0, 0 }); + protected IntBuffer lightsEnabled = Buffers.newDirectIntBuffer(new int[] { 0, 0, 0, 0, 0, 0, 0, 0 }); protected boolean lightsEnabledDirty = false; protected PMVMatrix pmvMatrix; @@ -525,23 +525,23 @@ public class FixedFuncPipeline { protected static final String mgl_CullFace = "mgl_CullFace"; // 1i - protected static final FloatBuffer zero4f = BufferUtil.newFloatBuffer(new float[] { 0.0f, 0.0f, 0.0f, 0.0f }); + protected static final FloatBuffer zero4f = Buffers.newDirectFloatBuffer(new float[] { 0.0f, 0.0f, 0.0f, 0.0f }); - public static final FloatBuffer defAmbient = BufferUtil.newFloatBuffer(new float[] { 0f, 0f, 0f, 1f }); + 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= BufferUtil.newFloatBuffer(new float[] { 0f, 0f, 1f, 0f }); - public static final FloatBuffer defSpotDir = BufferUtil.newFloatBuffer(new float[] { 0f, 0f, -1f }); + 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 = BufferUtil.newFloatBuffer(new float[] { 0.2f, 0.2f, 0.2f, 1.0f }); - public static final FloatBuffer defMatDiffuse = BufferUtil.newFloatBuffer(new float[] { 0.8f, 0.8f, 0.8f, 1.0f }); - public static final FloatBuffer defMatSpecular= BufferUtil.newFloatBuffer(new float[] { 0f, 0f, 0f, 1f}); - public static final FloatBuffer defMatEmission= BufferUtil.newFloatBuffer(new float[] { 0f, 0f, 0f, 1f}); + 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"; diff --git a/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/FixedFuncColor.fp b/src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/impl/shaders/FixedFuncColor.fp index 408ff7251..408ff7251 100644 --- a/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/FixedFuncColor.fp +++ b/src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/impl/shaders/FixedFuncColor.fp diff --git a/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/FixedFuncColor.vp b/src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/impl/shaders/FixedFuncColor.vp index 346e40196..346e40196 100644 --- a/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/FixedFuncColor.vp +++ b/src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/impl/shaders/FixedFuncColor.vp diff --git a/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/FixedFuncColorLight.vp b/src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/impl/shaders/FixedFuncColorLight.vp index ce203cfb9..ce203cfb9 100644 --- a/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/FixedFuncColorLight.vp +++ b/src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/impl/shaders/FixedFuncColorLight.vp diff --git a/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/FixedFuncColorTexture.fp b/src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/impl/shaders/FixedFuncColorTexture.fp index 86e6ace73..86e6ace73 100644 --- a/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/FixedFuncColorTexture.fp +++ b/src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/impl/shaders/FixedFuncColorTexture.fp diff --git a/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/bin/nvidia/FixedFuncColor.bfp b/src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/impl/shaders/bin/nvidia/FixedFuncColor.bfp Binary files differindex 3ebaaee1d..3ebaaee1d 100755 --- a/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/bin/nvidia/FixedFuncColor.bfp +++ b/src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/impl/shaders/bin/nvidia/FixedFuncColor.bfp diff --git a/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/bin/nvidia/FixedFuncColor.bvp b/src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/impl/shaders/bin/nvidia/FixedFuncColor.bvp Binary files differindex 279ef72c7..279ef72c7 100755 --- a/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/bin/nvidia/FixedFuncColor.bvp +++ b/src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/impl/shaders/bin/nvidia/FixedFuncColor.bvp diff --git a/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/bin/nvidia/FixedFuncColorLight.bvp b/src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/impl/shaders/bin/nvidia/FixedFuncColorLight.bvp Binary files differindex 5a9deea71..5a9deea71 100755 --- a/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/bin/nvidia/FixedFuncColorLight.bvp +++ b/src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/impl/shaders/bin/nvidia/FixedFuncColorLight.bvp diff --git a/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/bin/nvidia/FixedFuncColorTexture.bfp b/src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/impl/shaders/bin/nvidia/FixedFuncColorTexture.bfp Binary files differindex ce1397fe1..ce1397fe1 100755 --- a/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/bin/nvidia/FixedFuncColorTexture.bfp +++ b/src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/impl/shaders/bin/nvidia/FixedFuncColorTexture.bfp diff --git a/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/es_precision.glsl b/src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/impl/shaders/es_precision.glsl index fd6abe54e..fd6abe54e 100644 --- a/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/es_precision.glsl +++ b/src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/impl/shaders/es_precision.glsl diff --git a/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/mgl_attribute.glsl b/src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/impl/shaders/mgl_attribute.glsl index b09bdb05a..b09bdb05a 100644 --- a/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/mgl_attribute.glsl +++ b/src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/impl/shaders/mgl_attribute.glsl diff --git a/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/mgl_const.glsl b/src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/impl/shaders/mgl_const.glsl index 1a464a1cb..1a464a1cb 100644 --- a/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/mgl_const.glsl +++ b/src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/impl/shaders/mgl_const.glsl diff --git a/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/mgl_lightdef.glsl b/src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/impl/shaders/mgl_lightdef.glsl index 98e214139..98e214139 100644 --- a/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/mgl_lightdef.glsl +++ b/src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/impl/shaders/mgl_lightdef.glsl diff --git a/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/mgl_settexcoord.vp b/src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/impl/shaders/mgl_settexcoord.vp index 1efe328d0..1efe328d0 100644 --- a/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/mgl_settexcoord.vp +++ b/src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/impl/shaders/mgl_settexcoord.vp diff --git a/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/mgl_uniform.glsl b/src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/impl/shaders/mgl_uniform.glsl index d8b3c7f95..d8b3c7f95 100644 --- a/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/mgl_uniform.glsl +++ b/src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/impl/shaders/mgl_uniform.glsl diff --git a/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/mgl_uniform_light.glsl b/src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/impl/shaders/mgl_uniform_light.glsl index 0dedb5d5d..0dedb5d5d 100644 --- a/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/mgl_uniform_light.glsl +++ b/src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/impl/shaders/mgl_uniform_light.glsl diff --git a/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/mgl_varying.glsl b/src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/impl/shaders/mgl_varying.glsl index fc9f735d1..fc9f735d1 100644 --- a/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/mgl_varying.glsl +++ b/src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/impl/shaders/mgl_varying.glsl diff --git a/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/scripts/nvidia-apx/glslc-ff.bat b/src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/impl/shaders/scripts/nvidia-apx/glslc-ff.bat index 002dca8ef..8a2114e07 100755 --- a/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/scripts/nvidia-apx/glslc-ff.bat +++ b/src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/impl/shaders/scripts/nvidia-apx/glslc-ff.bat @@ -6,4 +6,4 @@ IF !"%JOGLDIR%"==""! GOTO YESPATH set JOGLDIR=..\lib :YESPATH -java -cp %JOGLDIR%\jogl.core.jar;%JOGLDIR%\jogl.gles2.jar;%JOGLDIR%\jogl.fixed.jar;%JOGLDIR%\jogl.sdk.jar com.sun.opengl.util.glsl.sdk.CompileShaderNVidia FixedFuncColor.fp FixedFuncColorTexture.fp FixedFuncColorLight.vp FixedFuncColor.vp +java -cp %JOGLDIR%\jogl.core.jar;%JOGLDIR%\jogl.gles2.jar;%JOGLDIR%\jogl.fixed.jar;%JOGLDIR%\jogl.sdk.jar com.jogamp.opengl.util.glsl.sdk.CompileShaderNVidia FixedFuncColor.fp FixedFuncColorTexture.fp FixedFuncColorLight.vp FixedFuncColor.vp diff --git a/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/scripts/nvidia-apx/glslc.bat b/src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/impl/shaders/scripts/nvidia-apx/glslc.bat index 9b5a4b39c..c7ca0a8b7 100755 --- a/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/scripts/nvidia-apx/glslc.bat +++ b/src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/impl/shaders/scripts/nvidia-apx/glslc.bat @@ -6,4 +6,4 @@ IF !"%JOGLDIR%"==""! GOTO YESPATH set JOGLDIR=..\lib :YESPATH -java -cp %JOGLDIR%\jogl.core.jar;%JOGLDIR%\jogl.gles2.jar;%JOGLDIR%\jogl.fixed.jar;%JOGLDIR%\jogl.sdk.jar com.sun.opengl.util.glsl.sdk.CompileShaderNVidia %1 +java -cp %JOGLDIR%\jogl.core.jar;%JOGLDIR%\jogl.gles2.jar;%JOGLDIR%\jogl.fixed.jar;%JOGLDIR%\jogl.sdk.jar com.jogamp.opengl.util.glsl.sdk.CompileShaderNVidia %1 diff --git a/src/jogl/classes/com/sun/opengl/util/glsl/sdk/CompileShader.java b/src/jogl/classes/com/jogamp/opengl/util/glsl/sdk/CompileShader.java index f18005feb..a0eed50ea 100755 --- a/src/jogl/classes/com/sun/opengl/util/glsl/sdk/CompileShader.java +++ b/src/jogl/classes/com/jogamp/opengl/util/glsl/sdk/CompileShader.java @@ -1,22 +1,23 @@ -package com.sun.opengl.util.glsl.sdk; +package com.jogamp.opengl.util.glsl.sdk; import javax.media.opengl.*; -import com.sun.opengl.util.*; -import com.sun.opengl.util.glsl.*; +import com.jogamp.opengl.util.*; +import com.jogamp.opengl.util.glsl.*; import java.io.*; import java.net.*; -/** Precompiles a shader into a vendor binary format. Input is the - resource name of the shader, such as - "com/sun/opengl/impl/glsl/fixed/shader/a.fp". - Output is "com/sun/opengl/impl/glsl/fixed/shader/bin/nvidia/a.bfp". - - All path and suffixes are determined by the ShaderCode class, - which ensures runtime compatibility. - - @see javax.media.opengl.glsl.ShaderCode - */ +/** + * Precompiles a shader into a vendor binary format. Input is the + * resource name of the shader, such as + * "com/jogamp/opengl/impl/glsl/fixed/shader/a.fp". + * Output is "com/jogamp/opengl/impl/glsl/fixed/shader/bin/nvidia/a.bfp". + * + * All path and suffixes are determined by the ShaderCode class, + * which ensures runtime compatibility. + * + * @see com.jogamp.opengl.util.glsl.ShaderCode + */ public abstract class CompileShader { diff --git a/src/jogl/classes/com/sun/opengl/util/glsl/sdk/CompileShaderNVidia.java b/src/jogl/classes/com/jogamp/opengl/util/glsl/sdk/CompileShaderNVidia.java index 387ccf732..8eb9ef579 100755 --- a/src/jogl/classes/com/sun/opengl/util/glsl/sdk/CompileShaderNVidia.java +++ b/src/jogl/classes/com/jogamp/opengl/util/glsl/sdk/CompileShaderNVidia.java @@ -1,4 +1,4 @@ -package com.sun.opengl.util.glsl.sdk; +package com.jogamp.opengl.util.glsl.sdk; import javax.media.opengl.*; @@ -6,8 +6,8 @@ import java.io.*; /** Precompiles a shader into NVidia binary format. Input is the resource name of the shader, such as - "com/sun/opengl/impl/glsl/fixed/shader/a.fp". - Output is "com/sun/opengl/impl/glsl/fixed/shader/bin/nvidia/a.bfp". */ + "com/jogamp/opengl/impl/glsl/fixed/shader/a.fp". + Output is "com/jogamp/opengl/impl/glsl/fixed/shader/bin/nvidia/a.bfp". */ public class CompileShaderNVidia extends CompileShader { private static final String NVAPSDK; diff --git a/src/jogl/classes/com/sun/opengl/util/packrect/BackingStoreManager.java b/src/jogl/classes/com/jogamp/opengl/util/packrect/BackingStoreManager.java index 754ba2757..7b6a1b479 100755 --- a/src/jogl/classes/com/sun/opengl/util/packrect/BackingStoreManager.java +++ b/src/jogl/classes/com/jogamp/opengl/util/packrect/BackingStoreManager.java @@ -37,7 +37,7 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.util.packrect; +package com.jogamp.opengl.util.packrect; /** This interface must be implemented by the end user and is called in response to events like addition of rectangles into the diff --git a/src/jogl/classes/com/sun/opengl/util/packrect/Level.java b/src/jogl/classes/com/jogamp/opengl/util/packrect/Level.java index 3dae4301d..5ba3f7330 100755 --- a/src/jogl/classes/com/sun/opengl/util/packrect/Level.java +++ b/src/jogl/classes/com/jogamp/opengl/util/packrect/Level.java @@ -37,7 +37,7 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.util.packrect; +package com.jogamp.opengl.util.packrect; import java.util.*; diff --git a/src/jogl/classes/com/sun/opengl/util/packrect/LevelSet.java b/src/jogl/classes/com/jogamp/opengl/util/packrect/LevelSet.java index 973980fdc..6783aec3b 100755 --- a/src/jogl/classes/com/sun/opengl/util/packrect/LevelSet.java +++ b/src/jogl/classes/com/jogamp/opengl/util/packrect/LevelSet.java @@ -37,7 +37,7 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.util.packrect; +package com.jogamp.opengl.util.packrect; import java.util.*; diff --git a/src/jogl/classes/com/sun/opengl/util/packrect/Rect.java b/src/jogl/classes/com/jogamp/opengl/util/packrect/Rect.java index 2f12981a6..6206c4a11 100755 --- a/src/jogl/classes/com/sun/opengl/util/packrect/Rect.java +++ b/src/jogl/classes/com/jogamp/opengl/util/packrect/Rect.java @@ -37,7 +37,7 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.util.packrect; +package com.jogamp.opengl.util.packrect; /** Represents a rectangular region on the backing store. The edges of the rectangle are the infinitely thin region between adjacent diff --git a/src/jogl/classes/com/sun/opengl/util/packrect/RectVisitor.java b/src/jogl/classes/com/jogamp/opengl/util/packrect/RectVisitor.java index 8f395ed99..49cfc82e6 100755 --- a/src/jogl/classes/com/sun/opengl/util/packrect/RectVisitor.java +++ b/src/jogl/classes/com/jogamp/opengl/util/packrect/RectVisitor.java @@ -37,7 +37,7 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.util.packrect; +package com.jogamp.opengl.util.packrect; /** Iteration construct without exposing the internals of the RectanglePacker and without implementing a complex Iterator. */ diff --git a/src/jogl/classes/com/sun/opengl/util/packrect/RectanglePacker.java b/src/jogl/classes/com/jogamp/opengl/util/packrect/RectanglePacker.java index 51e6842c0..1496a04a6 100755 --- a/src/jogl/classes/com/sun/opengl/util/packrect/RectanglePacker.java +++ b/src/jogl/classes/com/jogamp/opengl/util/packrect/RectanglePacker.java @@ -37,7 +37,7 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.util.packrect; +package com.jogamp.opengl.util.packrect; import java.util.*; diff --git a/src/jogl/classes/com/sun/opengl/util/packrect/package.html b/src/jogl/classes/com/jogamp/opengl/util/packrect/package.html index c1c5db477..c1c5db477 100755 --- a/src/jogl/classes/com/sun/opengl/util/packrect/package.html +++ b/src/jogl/classes/com/jogamp/opengl/util/packrect/package.html diff --git a/src/jogl/classes/com/sun/opengl/util/texture/Texture.java b/src/jogl/classes/com/jogamp/opengl/util/texture/Texture.java index 3a2799cf3..57ac0d45a 100755 --- a/src/jogl/classes/com/sun/opengl/util/texture/Texture.java +++ b/src/jogl/classes/com/jogamp/opengl/util/texture/Texture.java @@ -34,7 +34,7 @@ * facility. */ -package com.sun.opengl.util.texture; +package com.jogamp.opengl.util.texture; import java.nio.*; import java.security.*; @@ -42,9 +42,9 @@ import java.security.*; import javax.media.opengl.*; import javax.media.opengl.glu.*; import javax.media.nativewindow.NativeWindowFactory; -import com.sun.opengl.impl.*; -import com.sun.opengl.util.texture.*; -import com.sun.opengl.util.texture.spi.*; +import com.jogamp.opengl.impl.*; +import com.jogamp.opengl.util.texture.*; +import com.jogamp.opengl.util.texture.spi.*; /** * Represents an OpenGL texture object. Contains convenience routines @@ -487,7 +487,7 @@ public class Texture { } if (!done && preferTexRect(gl) && !isPOT && - haveTexRect(gl) && !data.isDataCompressed() && gl.isGL2()) { + haveTexRect(gl) && !data.isDataCompressed() && !gl.isGL3() && !gl.isGLES()) { // GL_ARB_texture_rectangle does not work for compressed textures if (DEBUG) { System.err.println("Using GL_ARB_texture_rectangle preferentially on this hardware"); @@ -514,7 +514,7 @@ public class Texture { done = true; } - if (!done && haveTexRect(gl) && !data.isDataCompressed() && gl.isGL2()) { + if (!done && haveTexRect(gl) && !data.isDataCompressed() && !gl.isGL3() && !gl.isGLES()) { // GL_ARB_texture_rectangle does not work for compressed textures if (DEBUG) { System.err.println("Using GL_ARB_texture_rectangle"); @@ -1013,10 +1013,10 @@ public class Texture { int[] skipRows = { 0 }; int[] skipPixels = { 0 }; gl.glGetIntegerv(GL.GL_UNPACK_ALIGNMENT, align, 0); // save alignment - if(gl.isGL2()) { - gl.glGetIntegerv(GL2.GL_UNPACK_ROW_LENGTH, rowLength, 0); // save row length - gl.glGetIntegerv(GL2.GL_UNPACK_SKIP_ROWS, skipRows, 0); // save skipped rows - gl.glGetIntegerv(GL2.GL_UNPACK_SKIP_PIXELS, skipPixels, 0); // save skipped pixels + if(gl.isGL2GL3()) { + gl.glGetIntegerv(GL2GL3.GL_UNPACK_ROW_LENGTH, rowLength, 0); // save row length + gl.glGetIntegerv(GL2GL3.GL_UNPACK_SKIP_ROWS, skipRows, 0); // save skipped rows + gl.glGetIntegerv(GL2GL3.GL_UNPACK_SKIP_PIXELS, skipPixels, 0); // save skipped pixels } gl.glPixelStorei(GL.GL_UNPACK_ALIGNMENT, data.getAlignment()); if (DEBUG && VERBOSE) { @@ -1028,10 +1028,10 @@ public class Texture { System.out.println("width = " + width); System.out.println("height = " + height); } - if(gl.isGL2()) { - gl.glPixelStorei(GL2.GL_UNPACK_ROW_LENGTH, rowlen); - gl.glPixelStorei(GL2.GL_UNPACK_SKIP_ROWS, srcy); - gl.glPixelStorei(GL2.GL_UNPACK_SKIP_PIXELS, srcx); + if(gl.isGL2GL3()) { + gl.glPixelStorei(GL2GL3.GL_UNPACK_ROW_LENGTH, rowlen); + gl.glPixelStorei(GL2GL3.GL_UNPACK_SKIP_ROWS, srcy); + gl.glPixelStorei(GL2GL3.GL_UNPACK_SKIP_PIXELS, srcx); } else { if ( rowlen!=0 && rowlen!=width && srcy!=0 && srcx!=0 ) { @@ -1044,10 +1044,10 @@ public class Texture { data.getPixelFormat(), data.getPixelType(), buffer); gl.glPixelStorei(GL.GL_UNPACK_ALIGNMENT, align[0]); // restore alignment - if(gl.isGL2()) { - gl.glPixelStorei(GL2.GL_UNPACK_ROW_LENGTH, rowLength[0]); // restore row length - gl.glPixelStorei(GL2.GL_UNPACK_SKIP_ROWS, skipRows[0]); // restore skipped rows - gl.glPixelStorei(GL2.GL_UNPACK_SKIP_PIXELS, skipPixels[0]); // restore skipped pixels + if(gl.isGL2GL3()) { + gl.glPixelStorei(GL2GL3.GL_UNPACK_ROW_LENGTH, rowLength[0]); // restore row length + gl.glPixelStorei(GL2GL3.GL_UNPACK_SKIP_ROWS, skipRows[0]); // restore skipped rows + gl.glPixelStorei(GL2GL3.GL_UNPACK_SKIP_PIXELS, skipPixels[0]); // restore skipped pixels } } } diff --git a/src/jogl/classes/com/sun/opengl/util/texture/TextureCoords.java b/src/jogl/classes/com/jogamp/opengl/util/texture/TextureCoords.java index 51710e077..8d8b3679d 100755 --- a/src/jogl/classes/com/sun/opengl/util/texture/TextureCoords.java +++ b/src/jogl/classes/com/jogamp/opengl/util/texture/TextureCoords.java @@ -34,7 +34,7 @@ * facility. */ -package com.sun.opengl.util.texture; +package com.jogamp.opengl.util.texture; /** Specifies texture coordinates for a rectangular area of a texture. Note that some textures are inherently flipped vertically diff --git a/src/jogl/classes/com/sun/opengl/util/texture/TextureData.java b/src/jogl/classes/com/jogamp/opengl/util/texture/TextureData.java index 8ac4b9b84..f598422bf 100755 --- a/src/jogl/classes/com/sun/opengl/util/texture/TextureData.java +++ b/src/jogl/classes/com/jogamp/opengl/util/texture/TextureData.java @@ -34,12 +34,12 @@ * facility. */ -package com.sun.opengl.util.texture; +package com.jogamp.opengl.util.texture; import java.nio.*; import javax.media.opengl.*; -import com.sun.opengl.util.*; +import com.jogamp.opengl.util.*; /** * Represents the data for an OpenGL texture. This is separated from @@ -49,6 +49,7 @@ import com.sun.opengl.util.*; * * @author Chris Campbell * @author Kenneth Russell + * @author Sven Gothel */ public class TextureData { @@ -74,6 +75,7 @@ public class TextureData { // These booleans are a concession to the AWTTextureData subclass protected boolean haveEXTABGR; protected boolean haveGL12; + protected GLProfile glProfile; /** * Constructs a new TextureData object with the specified parameters @@ -83,6 +85,8 @@ public class TextureData { * memory-mapped files that might otherwise require a garbage * collection to reclaim and close. * + * @param glp the OpenGL Profile this texture data should be + * created for. * @param internalFormat the OpenGL internal format for the * resulting texture; must be specified, may * not be 0 @@ -113,7 +117,8 @@ public class TextureData { * data were invalid, such as requesting mipmap generation for a * compressed texture */ - public TextureData(int internalFormat, + public TextureData(GLProfile glp, + int internalFormat, int width, int height, int border, @@ -128,6 +133,7 @@ public class TextureData { throw new IllegalArgumentException("Can not generate mipmaps for compressed textures"); } + this.glProfile = glp; this.width = width; this.height = height; this.border = border; @@ -151,6 +157,8 @@ public class TextureData { * complete; for example, closing of memory-mapped files that might * otherwise require a garbage collection to reclaim and close. * + * @param glp the OpenGL Profile this texture data should be + * created for. * @param internalFormat the OpenGL internal format for the * resulting texture; must be specified, may * not be 0 @@ -180,7 +188,8 @@ public class TextureData { * data were invalid, such as requesting mipmap generation for a * compressed texture */ - public TextureData(int internalFormat, + public TextureData(GLProfile glp, + int internalFormat, int width, int height, int border, @@ -190,6 +199,7 @@ public class TextureData { boolean mustFlipVertically, Buffer[] mipmapData, Flusher flusher) throws IllegalArgumentException { + this.glProfile = glp; this.width = width; this.height = height; this.border = border; @@ -207,15 +217,16 @@ public class TextureData { } /** Used only by subclasses */ - protected TextureData() { - } + protected TextureData(GLProfile glp) { this.glProfile = glp; } /** Returns the width in pixels of the texture data. */ public int getWidth() { return width; } /** Returns the height in pixels of the texture data. */ public int getHeight() { return height; } /** Returns the border in pixels of the texture data. */ - public int getBorder() { return border; } + public int getBorder() { + return border; + } /** Returns the intended OpenGL pixel format of the texture data. */ public int getPixelFormat() { return pixelFormat; @@ -225,27 +236,41 @@ public class TextureData { return pixelType; } /** Returns the intended OpenGL internal format of the texture data. */ - public int getInternalFormat() { return internalFormat; } + public int getInternalFormat() { + return internalFormat; + } /** Returns whether mipmaps should be generated for the texture data. */ - public boolean getMipmap() { return mipmap; } + public boolean getMipmap() { + return mipmap; + } /** Indicates whether the texture data is in compressed form. */ - public boolean isDataCompressed() { return dataIsCompressed; } + public boolean isDataCompressed() { + return dataIsCompressed; + } /** Indicates whether the texture coordinates must be flipped vertically for proper display. */ - public boolean getMustFlipVertically() { return mustFlipVertically; } + public boolean getMustFlipVertically() { + return mustFlipVertically; + } /** Returns the texture data, or null if it is specified as a set of mipmaps. */ public Buffer getBuffer() { return buffer; } /** Returns all mipmap levels for the texture data, or null if it is specified as a single image. */ - public Buffer[] getMipmapData() { return mipmapData; } + public Buffer[] getMipmapData() { + return mipmapData; + } /** Returns the required byte alignment for the texture data. */ - public int getAlignment() { return alignment; } + public int getAlignment() { + return alignment; + } /** Returns the row length needed for correct GL_UNPACK_ROW_LENGTH specification. This is currently only supported for non-mipmapped, non-compressed textures. */ - public int getRowLength() { return rowLength; } + public int getRowLength() { + return rowLength; + } /** Sets the width in pixels of the texture data. */ public void setWidth(int width) { this.width = width; } @@ -291,6 +316,9 @@ public class TextureData { this.haveGL12 = haveGL12; } + /** Returns the GLProfile this texture data is intended and created for. */ + public GLProfile getGLProfile() { return glProfile; } + /** Returns an estimate of the amount of memory in bytes this TextureData will consume once uploaded to the graphics card. It should only be treated as an estimate; most applications should @@ -337,6 +365,6 @@ public class TextureData { if (buffer == null) { return 0; } - return buffer.capacity() * BufferUtil.sizeOfBufferElem(buffer); + return buffer.capacity() * GLBuffers.sizeOfBufferElem(buffer); } } diff --git a/src/jogl/classes/com/sun/opengl/util/texture/TextureIO.java.javame_cdc_fp b/src/jogl/classes/com/jogamp/opengl/util/texture/TextureIO.java.javame_cdc_fp index e7c80678f..dbd194d21 100755 --- a/src/jogl/classes/com/sun/opengl/util/texture/TextureIO.java.javame_cdc_fp +++ b/src/jogl/classes/com/jogamp/opengl/util/texture/TextureIO.java.javame_cdc_fp @@ -37,7 +37,7 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.util.texture; +package com.jogamp.opengl.util.texture; import java.io.*; import java.net.*; @@ -46,9 +46,9 @@ import java.util.*; import javax.media.opengl.*; import javax.media.opengl.glu.*; -import com.sun.opengl.impl.Debug; -import com.sun.opengl.util.*; -import com.sun.opengl.util.texture.spi.*; +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 @@ -155,6 +155,8 @@ public class TextureIO { /** * 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 @@ -171,18 +173,20 @@ public class TextureIO { * registered texture providers could read the file * @throws IOException if an error occurred while reading the file */ - public static TextureData newTextureData(File file, + public static TextureData newTextureData(GLProfile glp, File file, boolean mipmap, String fileSuffix) throws IOException { if (fileSuffix == null) { fileSuffix = FileUtil.getFileSuffix(file); } - return newTextureDataImpl(file, 0, 0, mipmap, fileSuffix); + 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 @@ -199,15 +203,17 @@ public class TextureIO { * registered texture providers could read the stream * @throws IOException if an error occurred while reading the stream */ - public static TextureData newTextureData(InputStream stream, + public static TextureData newTextureData(GLProfile glp, InputStream stream, boolean mipmap, String fileSuffix) throws IOException { - return newTextureDataImpl(stream, 0, 0, mipmap, fileSuffix); + 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 @@ -224,13 +230,13 @@ public class TextureIO { * registered texture providers could read the URL * @throws IOException if an error occurred while reading the URL */ - public static TextureData newTextureData(URL 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(url, 0, 0, mipmap, fileSuffix); + return newTextureDataImpl(glp, url, 0, 0, mipmap, fileSuffix); } //---------------------------------------------------------------------- @@ -248,6 +254,8 @@ public class TextureIO { * 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 @@ -270,7 +278,7 @@ public class TextureIO { * pixelFormat was 0 * @throws IOException if an error occurred while reading the file */ - public static TextureData newTextureData(File file, + public static TextureData newTextureData(GLProfile glp, File file, int internalFormat, int pixelFormat, boolean mipmap, @@ -283,7 +291,7 @@ public class TextureIO { fileSuffix = FileUtil.getFileSuffix(file); } - return newTextureDataImpl(file, internalFormat, pixelFormat, mipmap, fileSuffix); + return newTextureDataImpl(glp, file, internalFormat, pixelFormat, mipmap, fileSuffix); } /** @@ -294,6 +302,8 @@ public class TextureIO { * 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 @@ -316,7 +326,7 @@ public class TextureIO { * pixelFormat was 0 * @throws IOException if an error occurred while reading the stream */ - public static TextureData newTextureData(InputStream stream, + public static TextureData newTextureData(GLProfile glp, InputStream stream, int internalFormat, int pixelFormat, boolean mipmap, @@ -325,7 +335,7 @@ public class TextureIO { throw new IllegalArgumentException("internalFormat and pixelFormat must be non-zero"); } - return newTextureDataImpl(stream, internalFormat, pixelFormat, mipmap, fileSuffix); + return newTextureDataImpl(glp, stream, internalFormat, pixelFormat, mipmap, fileSuffix); } /** @@ -336,6 +346,8 @@ public class TextureIO { * 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 @@ -358,7 +370,7 @@ public class TextureIO { * pixelFormat was 0 * @throws IOException if an error occurred while reading the URL */ - public static TextureData newTextureData(URL url, + public static TextureData newTextureData(GLProfile glp, URL url, int internalFormat, int pixelFormat, boolean mipmap, @@ -371,7 +383,7 @@ public class TextureIO { fileSuffix = FileUtil.getFileSuffix(url.getPath()); } - return newTextureDataImpl(url, internalFormat, pixelFormat, mipmap, fileSuffix); + return newTextureDataImpl(glp, url, internalFormat, pixelFormat, mipmap, fileSuffix); } //---------------------------------------------------------------------- @@ -410,7 +422,8 @@ public class TextureIO { * OpenGL error occurred */ public static Texture newTexture(File file, boolean mipmap) throws IOException, GLException { - TextureData data = newTextureData(file, mipmap, FileUtil.getFileSuffix(file)); + GLProfile glp = GLContext.getCurrentGL().getGLProfile(); + TextureData data = newTextureData(glp, file, mipmap, FileUtil.getFileSuffix(file)); Texture texture = newTexture(data); data.flush(); return texture; @@ -437,7 +450,8 @@ public class TextureIO { * OpenGL error occurred */ public static Texture newTexture(InputStream stream, boolean mipmap, String fileSuffix) throws IOException, GLException { - TextureData data = newTextureData(stream, mipmap, fileSuffix); + GLProfile glp = GLContext.getCurrentGL().getGLProfile(); + TextureData data = newTextureData(glp, stream, mipmap, fileSuffix); Texture texture = newTexture(data); data.flush(); return texture; @@ -467,7 +481,8 @@ public class TextureIO { if (fileSuffix == null) { fileSuffix = FileUtil.getFileSuffix(url.getPath()); } - TextureData data = newTextureData(url, mipmap, fileSuffix); + GLProfile glp = GLContext.getCurrentGL().getGLProfile(); + TextureData data = newTextureData(glp, url, mipmap, fileSuffix); Texture texture = newTexture(data); data.flush(); return texture; @@ -580,7 +595,7 @@ public class TextureIO { 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(internalFormat, width, height, border, internalFormat, GL.GL_UNSIGNED_BYTE, + data = new TextureData(gl.getGLProfile(), internalFormat, width, height, border, internalFormat, GL.GL_UNSIGNED_BYTE, false, true, true, res, null); } else { int bytesPerPixel = 0; @@ -631,7 +646,7 @@ public class TextureIO { gl.glPixelStorei(GL2.GL_PACK_SKIP_PIXELS, packSkipPixels); gl.glPixelStorei(GL2.GL_PACK_SWAP_BYTES, packSwapBytes); - data = new TextureData(internalFormat, width, height, border, fetchedFormat, GL.GL_UNSIGNED_BYTE, + data = new TextureData(gl.getGLProfile(), internalFormat, width, height, border, fetchedFormat, GL.GL_UNSIGNED_BYTE, false, false, false, res, null); if (DEBUG) { @@ -719,7 +734,7 @@ public class TextureIO { try { // Use reflection to avoid compile-time dependencies on AWT-related classes TextureProvider provider = (TextureProvider) - Class.forName("com.sun.opengl.util.texture.spi.awt.IIOTextureProvider").newInstance(); + Class.forName("com.jogamp.opengl.util.texture.spi.awt.IIOTextureProvider").newInstance(); addTextureProvider(provider); } catch (Exception e) { if (DEBUG) { @@ -740,7 +755,7 @@ public class TextureIO { try { // Use reflection to avoid compile-time dependencies on AWT-related classes TextureWriter writer = (TextureWriter) - Class.forName("com.sun.opengl.util.texture.spi.awt.IIOTextureWriter").newInstance(); + Class.forName("com.jogamp.opengl.util.texture.spi.awt.IIOTextureWriter").newInstance(); addTextureWriter(writer); } catch (Exception e) { if (DEBUG) { @@ -758,7 +773,7 @@ public class TextureIO { } // Implementation methods - private static TextureData newTextureDataImpl(File file, + private static TextureData newTextureDataImpl(GLProfile glp, File file, int internalFormat, int pixelFormat, boolean mipmap, @@ -771,7 +786,7 @@ public class TextureIO { for (Iterator iter = textureProviders.iterator(); iter.hasNext(); ) { TextureProvider provider = (TextureProvider) iter.next(); - TextureData data = provider.newTextureData(file, + TextureData data = provider.newTextureData(glp, file, internalFormat, pixelFormat, mipmap, @@ -784,7 +799,7 @@ public class TextureIO { throw new IOException("No suitable reader for given file "+file.getAbsolutePath()); } - private static TextureData newTextureDataImpl(InputStream stream, + private static TextureData newTextureDataImpl(GLProfile glp, InputStream stream, int internalFormat, int pixelFormat, boolean mipmap, @@ -802,7 +817,7 @@ public class TextureIO { for (Iterator iter = textureProviders.iterator(); iter.hasNext(); ) { TextureProvider provider = (TextureProvider) iter.next(); - TextureData data = provider.newTextureData(stream, + TextureData data = provider.newTextureData(glp, stream, internalFormat, pixelFormat, mipmap, @@ -815,7 +830,7 @@ public class TextureIO { throw new IOException("No suitable reader for given stream"); } - private static TextureData newTextureDataImpl(URL url, + private static TextureData newTextureDataImpl(GLProfile glp, URL url, int internalFormat, int pixelFormat, boolean mipmap, @@ -828,7 +843,7 @@ public class TextureIO { for (Iterator iter = textureProviders.iterator(); iter.hasNext(); ) { TextureProvider provider = (TextureProvider) iter.next(); - TextureData data = provider.newTextureData(url, + TextureData data = provider.newTextureData(glp, url, internalFormat, pixelFormat, mipmap, @@ -844,7 +859,7 @@ public class TextureIO { //---------------------------------------------------------------------- // DDS provider -- supports files only for now static class DDSTextureProvider implements TextureProvider { - public TextureData newTextureData(File file, + public TextureData newTextureData(GLProfile glp, File file, int internalFormat, int pixelFormat, boolean mipmap, @@ -852,13 +867,13 @@ public class TextureIO { if (DDS.equals(fileSuffix) || DDS.equals(FileUtil.getFileSuffix(file))) { DDSImage image = DDSImage.read(file); - return newTextureData(image, internalFormat, pixelFormat, mipmap); + return newTextureData(glp, image, internalFormat, pixelFormat, mipmap); } return null; } - public TextureData newTextureData(InputStream stream, + public TextureData newTextureData(GLProfile glp, InputStream stream, int internalFormat, int pixelFormat, boolean mipmap, @@ -866,26 +881,26 @@ public class TextureIO { if (DDS.equals(fileSuffix) || DDSImage.isDDSImage(stream)) { DDSImage image = DDSImage.read(stream); - return newTextureData(image, internalFormat, pixelFormat, mipmap); + return newTextureData(glp, image, internalFormat, pixelFormat, mipmap); } return null; } - public TextureData newTextureData(URL url, + 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(stream, internalFormat, pixelFormat, mipmap, fileSuffix); + return newTextureData(glp, stream, internalFormat, pixelFormat, mipmap, fileSuffix); } finally { stream.close(); } } - private TextureData newTextureData(final DDSImage image, + private TextureData newTextureData(GLProfile glp, final DDSImage image, int internalFormat, int pixelFormat, boolean mipmap) { @@ -937,7 +952,7 @@ public class TextureIO { for (int i = 0; i < image.getNumMipMaps(); i++) { mipmapData[i] = image.getMipMap(i).getData(); } - data = new TextureData(internalFormat, + data = new TextureData(glp, internalFormat, info.getWidth(), info.getHeight(), 0, @@ -951,7 +966,7 @@ public class TextureIO { // Fix this up for the end user because we can't generate // mipmaps for compressed textures mipmap = false; - data = new TextureData(internalFormat, + data = new TextureData(glp, internalFormat, info.getWidth(), info.getHeight(), 0, @@ -970,7 +985,7 @@ public class TextureIO { //---------------------------------------------------------------------- // Base class for SGI RGB and TGA image providers static abstract class StreamBasedTextureProvider implements TextureProvider { - public TextureData newTextureData(File file, + public TextureData newTextureData(GLProfile glp, File file, int internalFormat, int pixelFormat, boolean mipmap, @@ -980,7 +995,7 @@ public class TextureIO { // The SGIImage and TGAImage implementations use InputStreams // anyway so there isn't much point in having a separate code // path for files - return newTextureData(inStream, + return newTextureData(glp, inStream, internalFormat, pixelFormat, mipmap, @@ -990,14 +1005,14 @@ public class TextureIO { } } - public TextureData newTextureData(URL url, + 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(stream, internalFormat, pixelFormat, mipmap, fileSuffix); + return newTextureData(glp, stream, internalFormat, pixelFormat, mipmap, fileSuffix); } finally { stream.close(); } @@ -1007,7 +1022,7 @@ public class TextureIO { //---------------------------------------------------------------------- // SGI RGB image provider static class SGITextureProvider extends StreamBasedTextureProvider { - public TextureData newTextureData(InputStream stream, + public TextureData newTextureData(GLProfile glp, InputStream stream, int internalFormat, int pixelFormat, boolean mipmap, @@ -1022,7 +1037,7 @@ public class TextureIO { if (internalFormat == 0) { internalFormat = image.getFormat(); } - return new TextureData(internalFormat, + return new TextureData(glp, internalFormat, image.getWidth(), image.getHeight(), 0, @@ -1042,7 +1057,7 @@ public class TextureIO { //---------------------------------------------------------------------- // TGA (Targa) image provider static class TGATextureProvider extends StreamBasedTextureProvider { - public TextureData newTextureData(InputStream stream, + public TextureData newTextureData(GLProfile glp, InputStream stream, int internalFormat, int pixelFormat, boolean mipmap, @@ -1060,7 +1075,7 @@ public class TextureIO { internalFormat = (image.getBytesPerPixel()==4)?GL.GL_RGBA:GL.GL_RGB; } } - return new TextureData(internalFormat, + return new TextureData(glp, internalFormat, image.getWidth(), image.getHeight(), 0, diff --git a/src/jogl/classes/com/sun/opengl/util/texture/TextureIO.java.javase b/src/jogl/classes/com/jogamp/opengl/util/texture/TextureIO.java.javase index 556d51343..3e6f66f10 100755 --- a/src/jogl/classes/com/sun/opengl/util/texture/TextureIO.java.javase +++ b/src/jogl/classes/com/jogamp/opengl/util/texture/TextureIO.java.javase @@ -37,7 +37,7 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.util.texture; +package com.jogamp.opengl.util.texture; import java.io.*; import java.net.*; @@ -46,9 +46,9 @@ import java.util.*; import javax.media.opengl.*; import javax.media.opengl.glu.*; -import com.sun.opengl.impl.Debug; -import com.sun.opengl.util.*; -import com.sun.opengl.util.texture.spi.*; +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 @@ -155,6 +155,8 @@ public class TextureIO { /** * 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 @@ -171,18 +173,20 @@ public class TextureIO { * registered texture providers could read the file * @throws IOException if an error occurred while reading the file */ - public static TextureData newTextureData(File file, + public static TextureData newTextureData(GLProfile glp, File file, boolean mipmap, String fileSuffix) throws IOException { if (fileSuffix == null) { fileSuffix = FileUtil.getFileSuffix(file); } - return newTextureDataImpl(file, 0, 0, mipmap, fileSuffix); + 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 @@ -199,15 +203,17 @@ public class TextureIO { * registered texture providers could read the stream * @throws IOException if an error occurred while reading the stream */ - public static TextureData newTextureData(InputStream stream, + public static TextureData newTextureData(GLProfile glp, InputStream stream, boolean mipmap, String fileSuffix) throws IOException { - return newTextureDataImpl(stream, 0, 0, mipmap, fileSuffix); + 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 @@ -224,13 +230,13 @@ public class TextureIO { * registered texture providers could read the URL * @throws IOException if an error occurred while reading the URL */ - public static TextureData newTextureData(URL 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(url, 0, 0, mipmap, fileSuffix); + return newTextureDataImpl(glp, url, 0, 0, mipmap, fileSuffix); } //---------------------------------------------------------------------- @@ -248,6 +254,8 @@ public class TextureIO { * 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 @@ -270,7 +278,7 @@ public class TextureIO { * pixelFormat was 0 * @throws IOException if an error occurred while reading the file */ - public static TextureData newTextureData(File file, + public static TextureData newTextureData(GLProfile glp, File file, int internalFormat, int pixelFormat, boolean mipmap, @@ -283,7 +291,7 @@ public class TextureIO { fileSuffix = FileUtil.getFileSuffix(file); } - return newTextureDataImpl(file, internalFormat, pixelFormat, mipmap, fileSuffix); + return newTextureDataImpl(glp, file, internalFormat, pixelFormat, mipmap, fileSuffix); } /** @@ -294,6 +302,8 @@ public class TextureIO { * 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 @@ -316,7 +326,7 @@ public class TextureIO { * pixelFormat was 0 * @throws IOException if an error occurred while reading the stream */ - public static TextureData newTextureData(InputStream stream, + public static TextureData newTextureData(GLProfile glp, InputStream stream, int internalFormat, int pixelFormat, boolean mipmap, @@ -325,7 +335,7 @@ public class TextureIO { throw new IllegalArgumentException("internalFormat and pixelFormat must be non-zero"); } - return newTextureDataImpl(stream, internalFormat, pixelFormat, mipmap, fileSuffix); + return newTextureDataImpl(glp, stream, internalFormat, pixelFormat, mipmap, fileSuffix); } /** @@ -336,6 +346,8 @@ public class TextureIO { * 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 @@ -358,7 +370,7 @@ public class TextureIO { * pixelFormat was 0 * @throws IOException if an error occurred while reading the URL */ - public static TextureData newTextureData(URL url, + public static TextureData newTextureData(GLProfile glp, URL url, int internalFormat, int pixelFormat, boolean mipmap, @@ -371,7 +383,7 @@ public class TextureIO { fileSuffix = FileUtil.getFileSuffix(url.getPath()); } - return newTextureDataImpl(url, internalFormat, pixelFormat, mipmap, fileSuffix); + return newTextureDataImpl(glp, url, internalFormat, pixelFormat, mipmap, fileSuffix); } //---------------------------------------------------------------------- @@ -410,7 +422,8 @@ public class TextureIO { * OpenGL error occurred */ public static Texture newTexture(File file, boolean mipmap) throws IOException, GLException { - TextureData data = newTextureData(file, mipmap, FileUtil.getFileSuffix(file)); + GLProfile glp = GLContext.getCurrentGL().getGLProfile(); + TextureData data = newTextureData(glp, file, mipmap, FileUtil.getFileSuffix(file)); Texture texture = newTexture(data); data.flush(); return texture; @@ -437,7 +450,8 @@ public class TextureIO { * OpenGL error occurred */ public static Texture newTexture(InputStream stream, boolean mipmap, String fileSuffix) throws IOException, GLException { - TextureData data = newTextureData(stream, mipmap, fileSuffix); + GLProfile glp = GLContext.getCurrentGL().getGLProfile(); + TextureData data = newTextureData(glp, stream, mipmap, fileSuffix); Texture texture = newTexture(data); data.flush(); return texture; @@ -467,7 +481,8 @@ public class TextureIO { if (fileSuffix == null) { fileSuffix = FileUtil.getFileSuffix(url.getPath()); } - TextureData data = newTextureData(url, mipmap, fileSuffix); + GLProfile glp = GLContext.getCurrentGL().getGLProfile(); + TextureData data = newTextureData(glp, url, mipmap, fileSuffix); Texture texture = newTexture(data); data.flush(); return texture; @@ -580,7 +595,7 @@ public class TextureIO { 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(internalFormat, width, height, border, internalFormat, GL.GL_UNSIGNED_BYTE, + data = new TextureData(gl.getGLProfile(), internalFormat, width, height, border, internalFormat, GL.GL_UNSIGNED_BYTE, false, true, true, res, null); } else { int bytesPerPixel = 0; @@ -631,7 +646,7 @@ public class TextureIO { gl.glPixelStorei(GL2.GL_PACK_SKIP_PIXELS, packSkipPixels); gl.glPixelStorei(GL2.GL_PACK_SWAP_BYTES, packSwapBytes); - data = new TextureData(internalFormat, width, height, border, fetchedFormat, GL.GL_UNSIGNED_BYTE, + data = new TextureData(gl.getGLProfile(), internalFormat, width, height, border, fetchedFormat, GL.GL_UNSIGNED_BYTE, false, false, false, res, null); if (DEBUG) { @@ -718,7 +733,7 @@ public class TextureIO { try { // Use reflection to avoid compile-time dependencies on AWT-related classes TextureProvider provider = (TextureProvider) - Class.forName("com.sun.opengl.util.texture.spi.awt.IIOTextureProvider").newInstance(); + Class.forName("com.jogamp.opengl.util.texture.spi.awt.IIOTextureProvider").newInstance(); addTextureProvider(provider); } catch (Exception e) { if (DEBUG) { @@ -737,7 +752,7 @@ public class TextureIO { try { // Use reflection to avoid compile-time dependencies on AWT-related classes TextureWriter writer = (TextureWriter) - Class.forName("com.sun.opengl.util.texture.spi.awt.IIOTextureWriter").newInstance(); + Class.forName("com.jogamp.opengl.util.texture.spi.awt.IIOTextureWriter").newInstance(); addTextureWriter(writer); } catch (Exception e) { if (DEBUG) { @@ -758,7 +773,7 @@ public class TextureIO { } // Implementation methods - private static TextureData newTextureDataImpl(File file, + private static TextureData newTextureDataImpl(GLProfile glp, File file, int internalFormat, int pixelFormat, boolean mipmap, @@ -771,7 +786,7 @@ public class TextureIO { for (Iterator iter = textureProviders.iterator(); iter.hasNext(); ) { TextureProvider provider = (TextureProvider) iter.next(); - TextureData data = provider.newTextureData(file, + TextureData data = provider.newTextureData(glp, file, internalFormat, pixelFormat, mipmap, @@ -784,7 +799,7 @@ public class TextureIO { throw new IOException("No suitable reader for given file "+file.getAbsolutePath()); } - private static TextureData newTextureDataImpl(InputStream stream, + private static TextureData newTextureDataImpl(GLProfile glp, InputStream stream, int internalFormat, int pixelFormat, boolean mipmap, @@ -802,7 +817,7 @@ public class TextureIO { for (Iterator iter = textureProviders.iterator(); iter.hasNext(); ) { TextureProvider provider = (TextureProvider) iter.next(); - TextureData data = provider.newTextureData(stream, + TextureData data = provider.newTextureData(glp, stream, internalFormat, pixelFormat, mipmap, @@ -815,7 +830,7 @@ public class TextureIO { throw new IOException("No suitable reader for given stream"); } - private static TextureData newTextureDataImpl(URL url, + private static TextureData newTextureDataImpl(GLProfile glp, URL url, int internalFormat, int pixelFormat, boolean mipmap, @@ -828,7 +843,7 @@ public class TextureIO { for (Iterator iter = textureProviders.iterator(); iter.hasNext(); ) { TextureProvider provider = (TextureProvider) iter.next(); - TextureData data = provider.newTextureData(url, + TextureData data = provider.newTextureData(glp, url, internalFormat, pixelFormat, mipmap, @@ -844,7 +859,7 @@ public class TextureIO { //---------------------------------------------------------------------- // DDS provider -- supports files only for now static class DDSTextureProvider implements TextureProvider { - public TextureData newTextureData(File file, + public TextureData newTextureData(GLProfile glp, File file, int internalFormat, int pixelFormat, boolean mipmap, @@ -852,13 +867,13 @@ public class TextureIO { if (DDS.equals(fileSuffix) || DDS.equals(FileUtil.getFileSuffix(file))) { DDSImage image = DDSImage.read(file); - return newTextureData(image, internalFormat, pixelFormat, mipmap); + return newTextureData(glp, image, internalFormat, pixelFormat, mipmap); } return null; } - public TextureData newTextureData(InputStream stream, + public TextureData newTextureData(GLProfile glp, InputStream stream, int internalFormat, int pixelFormat, boolean mipmap, @@ -868,26 +883,26 @@ public class TextureIO { byte[] data = StreamUtil.readAll2Array(stream); ByteBuffer buf = ByteBuffer.wrap(data); DDSImage image = DDSImage.read(buf); - return newTextureData(image, internalFormat, pixelFormat, mipmap); + return newTextureData(glp, image, internalFormat, pixelFormat, mipmap); } return null; } - public TextureData newTextureData(URL url, + 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(stream, internalFormat, pixelFormat, mipmap, fileSuffix); + return newTextureData(glp, stream, internalFormat, pixelFormat, mipmap, fileSuffix); } finally { stream.close(); } } - private TextureData newTextureData(final DDSImage image, + private TextureData newTextureData(GLProfile glp, final DDSImage image, int internalFormat, int pixelFormat, boolean mipmap) { @@ -939,7 +954,7 @@ public class TextureIO { for (int i = 0; i < image.getNumMipMaps(); i++) { mipmapData[i] = image.getMipMap(i).getData(); } - data = new TextureData(internalFormat, + data = new TextureData(glp, internalFormat, info.getWidth(), info.getHeight(), 0, @@ -953,7 +968,7 @@ public class TextureIO { // Fix this up for the end user because we can't generate // mipmaps for compressed textures mipmap = false; - data = new TextureData(internalFormat, + data = new TextureData(glp, internalFormat, info.getWidth(), info.getHeight(), 0, @@ -972,7 +987,7 @@ public class TextureIO { //---------------------------------------------------------------------- // Base class for SGI RGB and TGA image providers static abstract class StreamBasedTextureProvider implements TextureProvider { - public TextureData newTextureData(File file, + public TextureData newTextureData(GLProfile glp, File file, int internalFormat, int pixelFormat, boolean mipmap, @@ -982,7 +997,7 @@ public class TextureIO { // The SGIImage and TGAImage implementations use InputStreams // anyway so there isn't much point in having a separate code // path for files - return newTextureData(inStream, + return newTextureData(glp, inStream, internalFormat, pixelFormat, mipmap, @@ -992,14 +1007,14 @@ public class TextureIO { } } - public TextureData newTextureData(URL url, + 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(stream, internalFormat, pixelFormat, mipmap, fileSuffix); + return newTextureData(glp, stream, internalFormat, pixelFormat, mipmap, fileSuffix); } finally { stream.close(); } @@ -1009,7 +1024,7 @@ public class TextureIO { //---------------------------------------------------------------------- // SGI RGB image provider static class SGITextureProvider extends StreamBasedTextureProvider { - public TextureData newTextureData(InputStream stream, + public TextureData newTextureData(GLProfile glp, InputStream stream, int internalFormat, int pixelFormat, boolean mipmap, @@ -1024,7 +1039,7 @@ public class TextureIO { if (internalFormat == 0) { internalFormat = image.getFormat(); } - return new TextureData(internalFormat, + return new TextureData(glp, internalFormat, image.getWidth(), image.getHeight(), 0, @@ -1044,7 +1059,7 @@ public class TextureIO { //---------------------------------------------------------------------- // TGA (Targa) image provider static class TGATextureProvider extends StreamBasedTextureProvider { - public TextureData newTextureData(InputStream stream, + public TextureData newTextureData(GLProfile glp, InputStream stream, int internalFormat, int pixelFormat, boolean mipmap, @@ -1062,7 +1077,7 @@ public class TextureIO { internalFormat = (image.getBytesPerPixel()==4)?GL.GL_RGBA:GL.GL_RGB; } } - return new TextureData(internalFormat, + return new TextureData(glp, internalFormat, image.getWidth(), image.getHeight(), 0, diff --git a/src/jogl/classes/com/sun/opengl/util/texture/awt/AWTTextureData.java b/src/jogl/classes/com/jogamp/opengl/util/texture/awt/AWTTextureData.java index b3cf537f6..39ec74b97 100755 --- a/src/jogl/classes/com/sun/opengl/util/texture/awt/AWTTextureData.java +++ b/src/jogl/classes/com/jogamp/opengl/util/texture/awt/AWTTextureData.java @@ -34,7 +34,7 @@ * facility. */ -package com.sun.opengl.util.texture.awt; +package com.jogamp.opengl.util.texture.awt; import java.awt.AlphaComposite; import java.awt.Color; @@ -45,7 +45,7 @@ import java.awt.image.*; import java.nio.*; import javax.media.opengl.*; -import com.sun.opengl.util.texture.*; +import com.jogamp.opengl.util.texture.*; public class AWTTextureData extends TextureData { // Mechanism for lazily converting input BufferedImages with custom @@ -77,6 +77,8 @@ public class AWTTextureData extends TextureData { * TextureData, that modification will be visible in the resulting * Texture. * + * @param glp the OpenGL Profile this texture data should be + * created for. * @param internalFormat the OpenGL internal format for the * resulting texture; may be 0, in which case * it is inferred from the image's type @@ -89,17 +91,18 @@ public class AWTTextureData extends TextureData { * texture * @param image the image containing the texture data */ - public AWTTextureData(int internalFormat, + public AWTTextureData(GLProfile glp, + int internalFormat, int pixelFormat, boolean mipmap, BufferedImage image) { - super(); + super(glp); if (internalFormat == 0) { this.internalFormat = image.getColorModel().hasAlpha() ? GL.GL_RGBA : GL.GL_RGB; } else { this.internalFormat = internalFormat; } - createFromImage(image); + createFromImage(glp, image); this.mipmap = mipmap; if (buffer != null) { estimatedMemorySize = estimatedMemorySize(buffer); @@ -146,7 +149,7 @@ public class AWTTextureData extends TextureData { return buffer; } - private void createFromImage(BufferedImage image) { + private void createFromImage(GLProfile glp, BufferedImage image) { pixelType = 0; // Determine from image mustFlipVertically = true; @@ -154,6 +157,7 @@ public class AWTTextureData extends TextureData { height = image.getHeight(); int scanlineStride; + SampleModel sm = image.getRaster().getSampleModel(); if (sm instanceof SinglePixelPackedSampleModel) { scanlineStride = @@ -170,21 +174,22 @@ public class AWTTextureData extends TextureData { return; } - GLProfile glp = GLContext.getCurrentGL().getGLProfile(); + width = image.getWidth(); + height = image.getHeight(); - if (glp.isGL2()) { + if (glp.isGL2GL3()) { switch (image.getType()) { case BufferedImage.TYPE_INT_RGB: - pixelFormat = GL2.GL_BGRA; - pixelType = GL2.GL_UNSIGNED_INT_8_8_8_8_REV; + pixelFormat = GL2GL3.GL_BGRA; + pixelType = GL2GL3.GL_UNSIGNED_INT_8_8_8_8_REV; rowLength = scanlineStride; alignment = 4; expectingGL12 = true; setupLazyCustomConversion(image); break; case BufferedImage.TYPE_INT_ARGB_PRE: - pixelFormat = GL2.GL_BGRA; - pixelType = GL2.GL_UNSIGNED_INT_8_8_8_8_REV; + pixelFormat = GL2GL3.GL_BGRA; + pixelType = GL2GL3.GL_UNSIGNED_INT_8_8_8_8_REV; rowLength = scanlineStride; alignment = 4; expectingGL12 = true; @@ -192,7 +197,7 @@ public class AWTTextureData extends TextureData { break; case BufferedImage.TYPE_INT_BGR: pixelFormat = GL.GL_RGBA; - pixelType = GL2.GL_UNSIGNED_INT_8_8_8_8_REV; + pixelType = GL2GL3.GL_UNSIGNED_INT_8_8_8_8_REV; rowLength = scanlineStride; alignment = 4; expectingGL12 = true; @@ -203,7 +208,7 @@ public class AWTTextureData extends TextureData { // we can pass the image data directly to OpenGL only if // we have an integral number of pixels in each scanline if ((scanlineStride % 3) == 0) { - pixelFormat = GL2.GL_BGR; + pixelFormat = GL2GL3.GL_BGR; pixelType = GL.GL_UNSIGNED_BYTE; rowLength = scanlineStride / 3; alignment = 1; @@ -223,7 +228,7 @@ public class AWTTextureData extends TextureData { // buggy at least on some NVidia drivers and doesn't perform // the necessary byte swapping (FIXME: needs more // investigation) - if ((scanlineStride % 4) == 0 && false) { + if ((scanlineStride % 4) == 0 && glp.isGL2() && false) { pixelFormat = GL2.GL_ABGR_EXT; pixelType = GL.GL_UNSIGNED_BYTE; rowLength = scanlineStride / 4; @@ -249,8 +254,8 @@ public class AWTTextureData extends TextureData { setupLazyCustomConversion(image); break; case BufferedImage.TYPE_USHORT_555_RGB: - pixelFormat = GL2.GL_BGRA; - pixelType = GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV; + pixelFormat = GL2GL3.GL_BGRA; + pixelType = GL2GL3.GL_UNSIGNED_SHORT_1_5_5_5_REV; rowLength = scanlineStride; alignment = 2; expectingGL12 = true; @@ -388,7 +393,7 @@ public class AWTTextureData extends TextureData { if (pixelType == 0) pixelType = GL.GL_FLOAT; } else if (data instanceof DataBufferInt) { // FIXME: should we support signed ints? - if (pixelType == 0) pixelType = GL2.GL_UNSIGNED_INT; + if (pixelType == 0) pixelType = GL2GL3.GL_UNSIGNED_INT; } else if (data instanceof DataBufferShort) { if (pixelType == 0) pixelType = GL.GL_SHORT; } else if (data instanceof DataBufferUShort) { diff --git a/src/jogl/classes/com/sun/opengl/util/texture/awt/AWTTextureIO.java b/src/jogl/classes/com/jogamp/opengl/util/texture/awt/AWTTextureIO.java index 490d150cc..fdd1365f7 100644 --- a/src/jogl/classes/com/sun/opengl/util/texture/awt/AWTTextureIO.java +++ b/src/jogl/classes/com/jogamp/opengl/util/texture/awt/AWTTextureIO.java @@ -37,26 +37,31 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.util.texture.awt; +package com.jogamp.opengl.util.texture.awt; import java.awt.image.*; import javax.media.opengl.*; -import com.sun.opengl.util.texture.*; +import com.jogamp.opengl.util.texture.*; public class AWTTextureIO extends TextureIO { /** * Creates a TextureData from the given BufferedImage. Does no * OpenGL work. + * We assume a desktop GLProfile GL2GL3, otherwise use the other factory. * + * @param glp the OpenGL Profile this texture data should be + * created for. * @param image the BufferedImage containing the texture data * @param mipmap whether mipmaps should be produced for this * texture by autogenerating them * @return the texture data from the image + * + * @see #newTextureData(GLProfile, BufferedImage, boolean) */ - public static TextureData newTextureData(BufferedImage image, + public static TextureData newTextureData(GLProfile glp, BufferedImage image, boolean mipmap) { - return newTextureDataImpl(image, 0, 0, mipmap); + return newTextureDataImpl(glp, image, 0, 0, mipmap); } /** @@ -67,6 +72,8 @@ public class AWTTextureIO extends TextureIO { * 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 image the BufferedImage containing the texture data * @param internalFormat the OpenGL internal format of the texture * which will eventually result from the TextureData @@ -82,7 +89,7 @@ public class AWTTextureIO extends TextureIO { * @throws IllegalArgumentException if either internalFormat or * pixelFormat was 0 */ - public static TextureData newTextureData(BufferedImage image, + public static TextureData newTextureData(GLProfile glp, BufferedImage image, int internalFormat, int pixelFormat, boolean mipmap) throws IllegalArgumentException { @@ -90,30 +97,33 @@ public class AWTTextureIO extends TextureIO { throw new IllegalArgumentException("internalFormat and pixelFormat must be non-zero"); } - return newTextureDataImpl(image, internalFormat, pixelFormat, mipmap); + return newTextureDataImpl(glp, image, internalFormat, pixelFormat, mipmap); } /** * Creates an OpenGL texture object from the specified BufferedImage * using the current OpenGL context. * + * @param glp the OpenGL Profile this texture data should be + * created for. * @param image the BufferedImage from which to read the texture data * @param mipmap whether mipmaps should be produced for this * texture by autogenerating them * @throws GLException if no OpenGL context is current or if an * OpenGL error occurred */ - public static Texture newTexture(BufferedImage image, boolean mipmap) throws GLException { - TextureData data = newTextureData(image, mipmap); + public static Texture newTexture(GLProfile glp, BufferedImage image, boolean mipmap) throws GLException { + TextureData data = newTextureData(glp, image, mipmap); Texture texture = newTexture(data); data.flush(); return texture; } - private static TextureData newTextureDataImpl(BufferedImage image, + private static TextureData newTextureDataImpl(GLProfile glp, + BufferedImage image, int internalFormat, int pixelFormat, boolean mipmap) { - return new AWTTextureData(internalFormat, pixelFormat, mipmap, image); + return new AWTTextureData(glp, internalFormat, pixelFormat, mipmap, image); } } diff --git a/src/jogl/classes/com/sun/opengl/util/texture/spi/DDSImage.java.javame_cdc_fp b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/DDSImage.java.javame_cdc_fp index ce3d97733..b18991dfc 100755 --- a/src/jogl/classes/com/sun/opengl/util/texture/spi/DDSImage.java.javame_cdc_fp +++ b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/DDSImage.java.javame_cdc_fp @@ -37,14 +37,14 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.util.texture.spi; +package com.jogamp.opengl.util.texture.spi; import java.io.*; import java.nio.*; import javax.media.opengl.*; -import com.sun.opengl.util.*; -import com.sun.opengl.util.texture.*; +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 @@ -478,7 +478,7 @@ public class DDSImage { } if (size == 0) size = 1; - return BufferUtil.newByteBuffer(size); + return GLBuffers.newDirectByteBuffer(size); } public void debugPrint() { diff --git a/src/jogl/classes/com/sun/opengl/util/texture/spi/DDSImage.java.javase b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/DDSImage.java.javase index 8a3e1c4be..e3092162d 100755 --- a/src/jogl/classes/com/sun/opengl/util/texture/spi/DDSImage.java.javase +++ b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/DDSImage.java.javase @@ -37,15 +37,15 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.util.texture.spi; +package com.jogamp.opengl.util.texture.spi; import java.io.*; import java.nio.*; import java.nio.channels.*; import javax.media.opengl.*; -import com.sun.opengl.util.*; -import com.sun.opengl.util.texture.*; +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 @@ -503,7 +503,7 @@ public class DDSImage { } if (size == 0) size = 1; - return BufferUtil.newByteBuffer(size); + return GLBuffers.newDirectByteBuffer(size); } public void debugPrint() { diff --git a/src/jogl/classes/com/sun/opengl/util/texture/spi/LEDataInputStream.java b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/LEDataInputStream.java index b2b1226bd..d5f49599c 100755 --- a/src/jogl/classes/com/sun/opengl/util/texture/spi/LEDataInputStream.java +++ b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/LEDataInputStream.java @@ -37,7 +37,7 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.util.texture.spi; +package com.jogamp.opengl.util.texture.spi; import java.io.DataInput; import java.io.DataInputStream; diff --git a/src/jogl/classes/com/sun/opengl/util/texture/spi/LEDataOutputStream.java b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/LEDataOutputStream.java index 730ec0dbd..e1e1ca924 100755 --- a/src/jogl/classes/com/sun/opengl/util/texture/spi/LEDataOutputStream.java +++ b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/LEDataOutputStream.java @@ -37,7 +37,7 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.util.texture.spi; +package com.jogamp.opengl.util.texture.spi; import java.io.DataOutput; import java.io.DataOutputStream; diff --git a/src/jogl/classes/com/sun/opengl/util/texture/spi/NetPbmTextureWriter.java b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/NetPbmTextureWriter.java index 18df1dc55..499dce7fb 100644 --- a/src/jogl/classes/com/sun/opengl/util/texture/spi/NetPbmTextureWriter.java +++ b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/NetPbmTextureWriter.java @@ -37,16 +37,16 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.util.texture.spi; +package com.jogamp.opengl.util.texture.spi; import java.io.*; import java.net.*; import java.nio.*; import javax.media.opengl.*; -import com.sun.opengl.util.*; -import com.sun.opengl.util.texture.*; -import com.sun.opengl.util.texture.spi.*; +import com.jogamp.opengl.util.*; +import com.jogamp.opengl.util.texture.*; +import com.jogamp.opengl.util.texture.spi.*; public class NetPbmTextureWriter implements TextureWriter { int magic; diff --git a/src/jogl/classes/com/sun/opengl/util/texture/spi/SGIImage.java b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/SGIImage.java index 284fa64bd..bb5040a31 100755 --- a/src/jogl/classes/com/sun/opengl/util/texture/spi/SGIImage.java +++ b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/SGIImage.java @@ -37,11 +37,11 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.util.texture.spi; +package com.jogamp.opengl.util.texture.spi; import java.io.*; import javax.media.opengl.*; -import com.sun.opengl.util.*; +import com.jogamp.opengl.util.*; /** <p> Reads and writes SGI RGB/RGBA images. </p> diff --git a/src/jogl/classes/com/sun/opengl/util/texture/spi/TGAImage.java.javame_cdc_fp b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/TGAImage.java.javame_cdc_fp index c54713a5e..6e6e4ab04 100755 --- a/src/jogl/classes/com/sun/opengl/util/texture/spi/TGAImage.java.javame_cdc_fp +++ b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/TGAImage.java.javame_cdc_fp @@ -37,14 +37,14 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.util.texture.spi; +package com.jogamp.opengl.util.texture.spi; import java.io.*; import java.nio.*; import javax.media.opengl.*; -import com.sun.opengl.util.*; -import com.sun.opengl.util.texture.spi.*; -import com.sun.opengl.util.texture.*; +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 = @@ -308,8 +308,8 @@ public class TGAImage { GL gl = GLContext.getCurrentGL(); if (header.pixelDepth() == 24) { bpp=3; - if(gl.isGL2()) { - format = GL2.GL_BGR; + if(gl.isGL2GL3()) { + format = GL2GL3.GL_BGR; } else { format = GL.GL_RGB; swapBGR(tmpData, rawWidth, header.height(), bpp); @@ -318,8 +318,8 @@ public class TGAImage { assert header.pixelDepth() == 32; bpp=4; - if(gl.isGL2()) { - format = GL2.GL_BGRA; + if(gl.isGL2GL3()) { + format = GL2GL3.GL_BGRA; } else { format = GL.GL_RGBA; swapBGR(tmpData, rawWidth, header.height(), bpp); diff --git a/src/jogl/classes/com/sun/opengl/util/texture/spi/TGAImage.java.javase b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/TGAImage.java.javase index 1e78ef20d..16ba538b5 100755 --- a/src/jogl/classes/com/sun/opengl/util/texture/spi/TGAImage.java.javase +++ b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/TGAImage.java.javase @@ -37,15 +37,15 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.util.texture.spi; +package com.jogamp.opengl.util.texture.spi; import java.io.*; import java.nio.*; import java.nio.channels.*; import javax.media.opengl.*; -import com.sun.opengl.util.*; -import com.sun.opengl.util.texture.spi.*; -import com.sun.opengl.util.texture.*; +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 = @@ -310,8 +310,8 @@ public class TGAImage { GL gl = GLContext.getCurrentGL(); if (header.pixelDepth() == 24) { bpp=3; - if(gl.isGL2()) { - format = GL2.GL_BGR; + if(gl.isGL2GL3()) { + format = GL2GL3.GL_BGR; } else { format = GL.GL_RGB; swapBGR(tmpData, rawWidth, header.height(), bpp); @@ -320,8 +320,8 @@ public class TGAImage { assert header.pixelDepth() == 32; bpp=4; - if(gl.isGL2()) { - format = GL2.GL_BGRA; + if(gl.isGL2GL3()) { + format = GL2GL3.GL_BGRA; } else { format = GL.GL_RGBA; swapBGR(tmpData, rawWidth, header.height(), bpp); diff --git a/src/jogl/classes/com/sun/opengl/util/texture/spi/TextureProvider.java b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/TextureProvider.java index baa087289..88018edbe 100755 --- a/src/jogl/classes/com/sun/opengl/util/texture/spi/TextureProvider.java +++ b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/TextureProvider.java @@ -37,12 +37,13 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.util.texture.spi; +package com.jogamp.opengl.util.texture.spi; import java.io.*; import java.net.*; +import javax.media.opengl.GLProfile; -import com.sun.opengl.util.texture.*; +import com.jogamp.opengl.util.texture.*; /** Plug-in interface to TextureIO to support reading OpenGL textures from new file formats. For all methods, either internalFormat or @@ -58,6 +59,8 @@ public interface TextureProvider { * do any OpenGL-related work. The resulting TextureData can be * converted into an OpenGL texture in a later step. * + * @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 to be used for @@ -83,7 +86,7 @@ public interface TextureProvider { * * @throws IOException if an error occurred while reading the file */ - public TextureData newTextureData(File file, + public TextureData newTextureData(GLProfile glp, File file, int internalFormat, int pixelFormat, boolean mipmap, @@ -95,6 +98,8 @@ public interface TextureProvider { * not do any OpenGL-related work. The resulting TextureData can be * converted into an OpenGL texture in a later step. * + * @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 to be used for @@ -120,7 +125,7 @@ public interface TextureProvider { * * @throws IOException if an error occurred while reading the stream */ - public TextureData newTextureData(InputStream stream, + public TextureData newTextureData(GLProfile glp, InputStream stream, int internalFormat, int pixelFormat, boolean mipmap, @@ -132,6 +137,8 @@ public interface TextureProvider { * do any OpenGL-related work. The resulting TextureData can be * converted into an OpenGL texture in a later step. * + * @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 to be used for @@ -157,7 +164,7 @@ public interface TextureProvider { * * @throws IOException if an error occurred while reading the URL */ - public TextureData newTextureData(URL url, + public TextureData newTextureData(GLProfile glp, URL url, int internalFormat, int pixelFormat, boolean mipmap, diff --git a/src/jogl/classes/com/sun/opengl/util/texture/spi/TextureWriter.java b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/TextureWriter.java index cdad15bb2..55527cef5 100755 --- a/src/jogl/classes/com/sun/opengl/util/texture/spi/TextureWriter.java +++ b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/TextureWriter.java @@ -37,11 +37,11 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.util.texture.spi; +package com.jogamp.opengl.util.texture.spi; import java.io.*; -import com.sun.opengl.util.texture.*; +import com.jogamp.opengl.util.texture.*; /** Plug-in interface to TextureIO to support writing OpenGL textures to new file formats. */ diff --git a/src/jogl/classes/com/sun/opengl/util/texture/spi/awt/IIOTextureProvider.java b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/awt/IIOTextureProvider.java index 0244db285..a45821d87 100644 --- a/src/jogl/classes/com/sun/opengl/util/texture/spi/awt/IIOTextureProvider.java +++ b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/awt/IIOTextureProvider.java @@ -37,23 +37,24 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.util.texture.spi.awt; +package com.jogamp.opengl.util.texture.spi.awt; import java.awt.Graphics; import java.awt.image.*; import java.io.*; import java.net.*; import javax.imageio.*; +import javax.media.opengl.GLProfile; -import com.sun.opengl.impl.Debug; -import com.sun.opengl.util.texture.*; -import com.sun.opengl.util.texture.awt.*; -import com.sun.opengl.util.texture.spi.*; +import com.jogamp.opengl.impl.Debug; +import com.jogamp.opengl.util.texture.*; +import com.jogamp.opengl.util.texture.awt.*; +import com.jogamp.opengl.util.texture.spi.*; public class IIOTextureProvider implements TextureProvider { private static final boolean DEBUG = Debug.debug("TextureIO"); - public TextureData newTextureData(File file, + public TextureData newTextureData(GLProfile glp, File file, int internalFormat, int pixelFormat, boolean mipmap, @@ -66,10 +67,10 @@ public class IIOTextureProvider implements TextureProvider { System.out.println("TextureIO.newTextureData(): BufferedImage type for " + file + " = " + img.getType()); } - return new AWTTextureData(internalFormat, pixelFormat, mipmap, img); + return new AWTTextureData(glp, internalFormat, pixelFormat, mipmap, img); } - public TextureData newTextureData(InputStream stream, + public TextureData newTextureData(GLProfile glp, InputStream stream, int internalFormat, int pixelFormat, boolean mipmap, @@ -82,17 +83,17 @@ public class IIOTextureProvider implements TextureProvider { System.out.println("TextureIO.newTextureData(): BufferedImage type for stream = " + img.getType()); } - return new AWTTextureData(internalFormat, pixelFormat, mipmap, img); + return new AWTTextureData(glp, internalFormat, pixelFormat, mipmap, img); } - public TextureData newTextureData(URL url, + public TextureData newTextureData(GLProfile glp, URL url, int internalFormat, int pixelFormat, boolean mipmap, String fileSuffix) throws IOException { InputStream stream = url.openStream(); try { - return newTextureData(stream, internalFormat, pixelFormat, mipmap, fileSuffix); + return newTextureData(glp, stream, internalFormat, pixelFormat, mipmap, fileSuffix); } finally { stream.close(); } diff --git a/src/jogl/classes/com/sun/opengl/util/texture/spi/awt/IIOTextureWriter.java b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/awt/IIOTextureWriter.java index db77572bf..405211204 100644 --- a/src/jogl/classes/com/sun/opengl/util/texture/spi/awt/IIOTextureWriter.java +++ b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/awt/IIOTextureWriter.java @@ -37,7 +37,7 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.util.texture.spi.awt; +package com.jogamp.opengl.util.texture.spi.awt; import java.awt.Graphics; import java.awt.image.*; @@ -47,10 +47,10 @@ import java.nio.*; import javax.imageio.*; import javax.media.opengl.*; -import com.sun.opengl.util.*; -import com.sun.opengl.util.awt.*; -import com.sun.opengl.util.texture.*; -import com.sun.opengl.util.texture.spi.*; +import com.jogamp.opengl.util.*; +import com.jogamp.opengl.util.awt.*; +import com.jogamp.opengl.util.texture.*; +import com.jogamp.opengl.util.texture.spi.*; public class IIOTextureWriter implements TextureWriter { public boolean write(File file, diff --git a/src/jogl/classes/com/sun/openmax/OMXEventListener.java b/src/jogl/classes/com/jogamp/openmax/OMXEventListener.java index ebbf7129f..08cfeccde 100644 --- a/src/jogl/classes/com/sun/openmax/OMXEventListener.java +++ b/src/jogl/classes/com/jogamp/openmax/OMXEventListener.java @@ -1,5 +1,5 @@ -package com.sun.openmax; +package com.jogamp.openmax; public interface OMXEventListener { diff --git a/src/jogl/classes/com/sun/openmax/OMXInstance.java b/src/jogl/classes/com/jogamp/openmax/OMXInstance.java index 2eff166d2..9f5b850ba 100644 --- a/src/jogl/classes/com/sun/openmax/OMXInstance.java +++ b/src/jogl/classes/com/jogamp/openmax/OMXInstance.java @@ -1,14 +1,14 @@ -package com.sun.openmax; +package com.jogamp.openmax; import javax.media.opengl.*; import javax.media.opengl.glu.GLU; -import com.sun.opengl.util.texture.*; +import com.jogamp.opengl.util.texture.*; -import com.sun.opengl.impl.egl.EGL; -import com.sun.opengl.impl.egl.EGLContext; -import com.sun.opengl.impl.egl.EGLDrawable; -import com.sun.opengl.impl.egl.EGLExt; +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 java.net.URL; import java.nio.ByteBuffer; @@ -50,13 +50,13 @@ public class OMXInstance { protected long o_totalFrames = 0; // duration in frames static class EGLImageTexture { - public EGLImageTexture(com.sun.opengl.util.texture.Texture t, long i, long s) { + public EGLImageTexture(com.jogamp.opengl.util.texture.Texture t, long i, long s) { texture = t; image = i; sync = s; } public String toString() { return "EGLImageTexture[" + texture + ", image " + image + ", sync "+sync+"]"; } - protected com.sun.opengl.util.texture.Texture texture; + protected com.jogamp.opengl.util.texture.Texture texture; protected long image; protected long sync; } @@ -219,7 +219,7 @@ public class OMXInstance { _setStreamEGLImageTexture2D(moviePtr, i, tex, image, sync); eglImgTexs[i] = new EGLImageTexture( - com.sun.opengl.util.texture.TextureIO.newTexture(tex, + com.jogamp.opengl.util.texture.TextureIO.newTexture(tex, javax.media.opengl.GL2.GL_TEXTURE_2D, width, height, diff --git a/src/jogl/classes/com/sun/opengl/util/BufferUtil.java.javame_cdc_fp b/src/jogl/classes/com/sun/opengl/util/BufferUtil.java.javame_cdc_fp deleted file mode 100755 index 40f035514..000000000 --- a/src/jogl/classes/com/sun/opengl/util/BufferUtil.java.javame_cdc_fp +++ /dev/null @@ -1,449 +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. - * - * 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.sun.opengl.util; - -import javax.media.opengl.GL; -import javax.media.opengl.GL2; -import javax.media.opengl.GL2ES2; -import javax.media.opengl.GLException; -import javax.media.opengl.GLProfile; - -import java.nio.*; -import java.util.*; - -import java.lang.reflect.*; - -/** Utility routines for dealing with direct buffers. */ - -public class BufferUtil { - public static final int SIZEOF_BYTE = 1; - public static final int SIZEOF_SHORT = 2; - public static final int SIZEOF_INT = 4; - public static final int SIZEOF_FLOAT = 4; - public static final int SIZEOF_LONG = -1; // not supported - public static final int SIZEOF_DOUBLE = -1; // not supported - - public static final int sizeOfGLType(int glType) { - switch (glType) { - case GL.GL_UNSIGNED_BYTE: - return SIZEOF_BYTE; - case GL.GL_BYTE: - return SIZEOF_BYTE; - case GL.GL_UNSIGNED_SHORT: - return SIZEOF_SHORT; - case GL.GL_SHORT: - return SIZEOF_SHORT; - case GL.GL_FLOAT: - return SIZEOF_FLOAT; - case GL.GL_FIXED: - return SIZEOF_INT; - case GL2ES2.GL_INT: - return SIZEOF_INT; - case GL2ES2.GL_UNSIGNED_INT: - return SIZEOF_INT; - case GL2.GL_DOUBLE: - return SIZEOF_DOUBLE; - } - return -1; - } - - public static final int sizeOfBufferElem(Buffer buffer) { - if (buffer == null) { - return 0; - } - if (buffer instanceof ByteBuffer) { - return BufferUtil.SIZEOF_BYTE; - } else if (buffer instanceof IntBuffer) { - return BufferUtil.SIZEOF_INT; - } else if (buffer instanceof ShortBuffer) { - return BufferUtil.SIZEOF_SHORT; - } else if (buffer instanceof FloatBuffer) { - return BufferUtil.SIZEOF_FLOAT; - } - throw new RuntimeException("Unexpected buffer type " + - buffer.getClass().getName()); - } - - private BufferUtil() {} - - //---------------------------------------------------------------------- - // Allocation routines - // - - public static final Buffer newGLBuffer(int glType, int numElements) { - switch (glType) { - case GL.GL_UNSIGNED_BYTE: - case GL.GL_BYTE: - return newByteBuffer(numElements); - case GL.GL_UNSIGNED_SHORT: - case GL.GL_SHORT: - return newShortBuffer(numElements); - case GL.GL_FLOAT: - return newFloatBuffer(numElements); - case GL.GL_FIXED: - case GL2ES2.GL_INT: - case GL2ES2.GL_UNSIGNED_INT: - return newIntBuffer(numElements); - } - return null; - } - - public static final Buffer sliceGLBuffer(ByteBuffer parent, int bytePos, int byteLen, int glType) { - if(parent==null || byteLen==0) return null; - parent.position(bytePos); - parent.limit(bytePos + byteLen); - - switch (glType) { - case GL.GL_UNSIGNED_BYTE: - case GL.GL_BYTE: - return parent.slice(); - case GL.GL_UNSIGNED_SHORT: - case GL.GL_SHORT: - return parent.asShortBuffer(); - case GL.GL_FLOAT: - return parent.asFloatBuffer(); - case GL.GL_FIXED: - case GL2ES2.GL_INT: - case GL2ES2.GL_UNSIGNED_INT: - return parent.asIntBuffer(); - } - return null; - } - - /** Allocates a new direct ByteBuffer with the specified number of - elements. The returned buffer will have its byte order set to - the host platform's native byte order. */ - public static ByteBuffer newByteBuffer(int numElements) { - ByteBuffer bb = ByteBuffer.allocateDirect(numElements); - nativeOrder(bb); - return bb; - } - - public static ByteBuffer newByteBuffer(byte[] values, int offset, int len) { - ByteBuffer bb = newByteBuffer(len); - bb.put(values, offset, len); - bb.rewind(); - return bb; - } - - public static ByteBuffer newByteBuffer(byte[] values, int offset) { - return newByteBuffer(values, offset, values.length-offset); - } - - public static ByteBuffer newByteBuffer(byte[] values) { - return newByteBuffer(values, 0); - } - - /** Allocates a new direct FloatBuffer with the specified number of - elements. The returned buffer will have its byte order set to - the host platform's native byte order. */ - public static FloatBuffer newFloatBuffer(int numElements) { - ByteBuffer bb = newByteBuffer(numElements * SIZEOF_FLOAT); - return bb.asFloatBuffer(); - } - - public static FloatBuffer newFloatBuffer(float[] values, int offset, int len) { - FloatBuffer bb = newFloatBuffer(len); - bb.put(values, offset, len); - bb.rewind(); - return bb; - } - - public static FloatBuffer newFloatBuffer(float[] values, int offset) { - return newFloatBuffer(values, 0, values.length-offset); - } - - public static FloatBuffer newFloatBuffer(float[] values) { - return newFloatBuffer(values, 0); - } - - /** Allocates a new direct IntBuffer with the specified number of - elements. The returned buffer will have its byte order set to - the host platform's native byte order. */ - public static IntBuffer newIntBuffer(int numElements) { - ByteBuffer bb = newByteBuffer(numElements * SIZEOF_INT); - return bb.asIntBuffer(); - } - - public static IntBuffer newIntBuffer(int[] values, int offset, int len) { - IntBuffer bb = newIntBuffer(len); - bb.put(values, offset, len); - bb.rewind(); - return bb; - } - - public static IntBuffer newIntBuffer(int[] values, int offset) { - return newIntBuffer(values, 0, values.length-offset); - } - - public static IntBuffer newIntBuffer(int[] values) { - return newIntBuffer(values, 0); - } - - - /** Allocates a new direct ShortBuffer with the specified number of - elements. The returned buffer will have its byte order set to - the host platform's native byte order. */ - public static ShortBuffer newShortBuffer(int numElements) { - ByteBuffer bb = newByteBuffer(numElements * SIZEOF_SHORT); - return bb.asShortBuffer(); - } - - public static ShortBuffer newShortBuffer(short[] values, int offset, int len) { - ShortBuffer bb = newShortBuffer(len); - bb.put(values, offset, len); - bb.rewind(); - return bb; - } - - public static ShortBuffer newShortBuffer(short[] values, int offset) { - return newShortBuffer(values, 0, values.length-offset); - } - - public static ShortBuffer newShortBuffer(short[] values) { - return newShortBuffer(values, 0); - } - - - //---------------------------------------------------------------------- - // Copy routines (type-to-type) - // - - /** Copies the <i>remaining</i> elements (as defined by - <code>limit() - position()</code>) in the passed ByteBuffer into - a newly-allocated direct ByteBuffer. The returned buffer will - have its byte order set to the host platform's native byte - order. The position of the newly-allocated buffer will be zero, - and the position of the passed buffer is unchanged (though its - mark is changed). */ - public static ByteBuffer copyByteBuffer(ByteBuffer orig) { - ByteBuffer dest = newByteBuffer(orig.remaining()); - dest.put(orig); - dest.rewind(); - return dest; - } - - /** Copies the <i>remaining</i> elements (as defined by - <code>limit() - position()</code>) in the passed FloatBuffer - into a newly-allocated direct FloatBuffer. The returned buffer - will have its byte order set to the host platform's native byte - order. The position of the newly-allocated buffer will be zero, - and the position of the passed buffer is unchanged (though its - mark is changed). */ - public static FloatBuffer copyFloatBuffer(FloatBuffer orig) { - return copyFloatBufferAsByteBuffer(orig).asFloatBuffer(); - } - - /** Copies the <i>remaining</i> elements (as defined by - <code>limit() - position()</code>) in the passed IntBuffer - into a newly-allocated direct IntBuffer. The returned buffer - will have its byte order set to the host platform's native byte - order. The position of the newly-allocated buffer will be zero, - and the position of the passed buffer is unchanged (though its - mark is changed). */ - public static IntBuffer copyIntBuffer(IntBuffer orig) { - return copyIntBufferAsByteBuffer(orig).asIntBuffer(); - } - - /** Copies the <i>remaining</i> elements (as defined by - <code>limit() - position()</code>) in the passed ShortBuffer - into a newly-allocated direct ShortBuffer. The returned buffer - will have its byte order set to the host platform's native byte - order. The position of the newly-allocated buffer will be zero, - and the position of the passed buffer is unchanged (though its - mark is changed). */ - public static ShortBuffer copyShortBuffer(ShortBuffer orig) { - return copyShortBufferAsByteBuffer(orig).asShortBuffer(); - } - - //---------------------------------------------------------------------- - // Copy routines (type-to-ByteBuffer) - // - - /** Copies the <i>remaining</i> elements (as defined by - <code>limit() - position()</code>) in the passed FloatBuffer - into a newly-allocated direct ByteBuffer. The returned buffer - will have its byte order set to the host platform's native byte - order. The position of the newly-allocated buffer will be zero, - and the position of the passed buffer is unchanged (though its - mark is changed). */ - public static ByteBuffer copyFloatBufferAsByteBuffer(FloatBuffer orig) { - ByteBuffer dest = newByteBuffer(orig.remaining() * SIZEOF_FLOAT); - dest.asFloatBuffer().put(orig); - dest.rewind(); - return dest; - } - - /** Copies the <i>remaining</i> elements (as defined by - <code>limit() - position()</code>) in the passed IntBuffer into - a newly-allocated direct ByteBuffer. The returned buffer will - have its byte order set to the host platform's native byte - order. The position of the newly-allocated buffer will be zero, - and the position of the passed buffer is unchanged (though its - mark is changed). */ - public static ByteBuffer copyIntBufferAsByteBuffer(IntBuffer orig) { - ByteBuffer dest = newByteBuffer(orig.remaining() * SIZEOF_INT); - dest.asIntBuffer().put(orig); - dest.rewind(); - return dest; - } - - /** Copies the <i>remaining</i> elements (as defined by - <code>limit() - position()</code>) in the passed ShortBuffer - into a newly-allocated direct ByteBuffer. The returned buffer - will have its byte order set to the host platform's native byte - order. The position of the newly-allocated buffer will be zero, - and the position of the passed buffer is unchanged (though its - mark is changed). */ - public static ByteBuffer copyShortBufferAsByteBuffer(ShortBuffer orig) { - ByteBuffer dest = newByteBuffer(orig.remaining() * SIZEOF_SHORT); - dest.asShortBuffer().put(orig); - dest.rewind(); - return dest; - } - - //---------------------------------------------------------------------- - // Conversion routines - // - - public final static float[] getFloatArray(double[] source) { - int i=source.length; - float[] dest = new float[i--]; - while(i>=0) { dest[i]=(float)source[i]; i--; } - return dest; - } - - public static ByteBuffer nativeOrder(ByteBuffer buf) { - if (!isCDCFP) { - try { - if (byteOrderClass == null) { - byteOrderClass = Class.forName("java.nio.ByteOrder"); - orderMethod = ByteBuffer.class.getMethod("order", new Class[] { byteOrderClass }); - Method nativeOrderMethod = byteOrderClass.getMethod("nativeOrder", null); - nativeOrderObject = nativeOrderMethod.invoke(null, null); - } - } catch (Throwable t) { - // Must be running on CDC / FP - isCDCFP = true; - } - - if (!isCDCFP) { - try { - orderMethod.invoke(buf, new Object[] { nativeOrderObject }); - } catch (Throwable t) { - } - } - } - return buf; - } - - //---------------------------------------------------------------------- - // Convenient GL put methods with generic target Buffer - // - public static void put(Buffer dest, Buffer v) { - if((dest instanceof ByteBuffer) && (v instanceof ByteBuffer)) { - ((ByteBuffer)dest).put((ByteBuffer)v); - } else if((dest instanceof ShortBuffer) && (v instanceof ShortBuffer)) { - ((ShortBuffer)dest).put((ShortBuffer)v); - } else if((dest instanceof IntBuffer) && (v instanceof IntBuffer)) { - ((IntBuffer)dest).put((IntBuffer)v); - } else if((dest instanceof FloatBuffer) && (v instanceof FloatBuffer)) { - ((FloatBuffer)dest).put((FloatBuffer)v); - } else { - throw new GLException("Incompatible Buffer classes: dest = "+dest.getClass().getName() + ", src = " + v.getClass().getName()); - } - } - - public static void putb(Buffer dest, byte v) { - if(dest instanceof ByteBuffer) { - ((ByteBuffer)dest).put(v); - } else if(dest instanceof ShortBuffer) { - ((ShortBuffer)dest).put((short)v); - } else if(dest instanceof IntBuffer) { - ((IntBuffer)dest).put((int)v); - } else { - throw new GLException("Byte doesn't match Buffer Class: "+dest); - } - } - - public static void puts(Buffer dest, short v) { - if(dest instanceof ShortBuffer) { - ((ShortBuffer)dest).put(v); - } else if(dest instanceof IntBuffer) { - ((IntBuffer)dest).put((int)v); - } else { - throw new GLException("Short doesn't match Buffer Class: "+dest); - } - } - - public static void puti(Buffer dest, int v) { - if(dest instanceof IntBuffer) { - ((IntBuffer)dest).put(v); - } else { - throw new GLException("Integer doesn't match Buffer Class: "+dest); - } - } - - public static void putx(Buffer dest, int v) { - puti(dest, v); - } - - public static void putf(Buffer dest, float v) { - if(dest instanceof FloatBuffer) { - ((FloatBuffer)dest).put(v); - } else if(dest instanceof IntBuffer) { - ((IntBuffer)dest).put(FixedPoint.toFixed(v)); - } else { - throw new GLException("Float doesn't match Buffer Class: "+dest); - } - } - - //---------------------------------------------------------------------- - // Internals only below this point - // - - // NOTE that this work must be done reflectively at the present time - // because this code must compile and run correctly on both CDC/FP and J2SE - private static boolean isCDCFP; - private static Class byteOrderClass; - private static Object nativeOrderObject; - private static Method orderMethod; - -} diff --git a/src/jogl/classes/com/sun/opengl/util/BufferUtil.java.javase b/src/jogl/classes/com/sun/opengl/util/BufferUtil.java.javase deleted file mode 100755 index d02f3d15f..000000000 --- a/src/jogl/classes/com/sun/opengl/util/BufferUtil.java.javase +++ /dev/null @@ -1,499 +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. - * - * 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.sun.opengl.util; - -import javax.media.opengl.GL; -import javax.media.opengl.GL2; -import javax.media.opengl.GL2ES2; -import javax.media.opengl.GLException; -import javax.media.opengl.GLProfile; - -import java.nio.*; -import java.util.*; - -import java.lang.reflect.*; - -/** Utility routines for dealing with direct buffers. */ - -public class BufferUtil { - public static final int SIZEOF_BYTE = 1; - public static final int SIZEOF_SHORT = 2; - public static final int SIZEOF_INT = 4; - public static final int SIZEOF_FLOAT = 4; - public static final int SIZEOF_LONG = 8; - public static final int SIZEOF_DOUBLE = 8; - - public static final int sizeOfGLType(int glType) { - switch (glType) { - case GL.GL_UNSIGNED_BYTE: - return SIZEOF_BYTE; - case GL.GL_BYTE: - return SIZEOF_BYTE; - case GL.GL_UNSIGNED_SHORT: - return SIZEOF_SHORT; - case GL.GL_SHORT: - return SIZEOF_SHORT; - case GL.GL_FLOAT: - return SIZEOF_FLOAT; - case GL.GL_FIXED: - return SIZEOF_INT; - case GL2ES2.GL_INT: - return SIZEOF_INT; - case GL2ES2.GL_UNSIGNED_INT: - return SIZEOF_INT; - case GL2.GL_DOUBLE: - return SIZEOF_DOUBLE; - } - return -1; - } - - public static final int sizeOfBufferElem(Buffer buffer) { - if (buffer == null) { - return 0; - } - if (buffer instanceof ByteBuffer) { - return BufferUtil.SIZEOF_BYTE; - } else if (buffer instanceof IntBuffer) { - return BufferUtil.SIZEOF_INT; - } else if (buffer instanceof ShortBuffer) { - return BufferUtil.SIZEOF_SHORT; - } else if (buffer instanceof FloatBuffer) { - return BufferUtil.SIZEOF_FLOAT; - } else if (buffer instanceof DoubleBuffer) { - return BufferUtil.SIZEOF_DOUBLE; - } - throw new RuntimeException("Unexpected buffer type " + - buffer.getClass().getName()); - } - - private BufferUtil() {} - - //---------------------------------------------------------------------- - // Allocation routines - // - - public static final Buffer newGLBuffer(int glType, int numElements) { - switch (glType) { - case GL.GL_UNSIGNED_BYTE: - case GL.GL_BYTE: - return newByteBuffer(numElements); - case GL.GL_UNSIGNED_SHORT: - case GL.GL_SHORT: - return newShortBuffer(numElements); - case GL.GL_FLOAT: - return newFloatBuffer(numElements); - case GL.GL_FIXED: - case GL2ES2.GL_INT: - case GL2ES2.GL_UNSIGNED_INT: - return newIntBuffer(numElements); - case GL2.GL_DOUBLE: - return newDoubleBuffer(numElements); - } - return null; - } - - public static final Buffer sliceGLBuffer(ByteBuffer parent, int bytePos, int byteLen, int glType) { - if(parent==null || byteLen==0) return null; - parent.position(bytePos); - parent.limit(bytePos + byteLen); - - switch (glType) { - case GL.GL_UNSIGNED_BYTE: - case GL.GL_BYTE: - return parent.slice(); - case GL.GL_UNSIGNED_SHORT: - case GL.GL_SHORT: - return parent.asShortBuffer(); - case GL.GL_FLOAT: - return parent.asFloatBuffer(); - case GL.GL_FIXED: - case GL2ES2.GL_INT: - case GL2ES2.GL_UNSIGNED_INT: - return parent.asIntBuffer(); - case GL2.GL_DOUBLE: - return parent.asDoubleBuffer(); - } - return null; - } - - /** Allocates a new direct ByteBuffer with the specified number of - elements. The returned buffer will have its byte order set to - the host platform's native byte order. */ - public static ByteBuffer newByteBuffer(int numElements) { - ByteBuffer bb = ByteBuffer.allocateDirect(numElements); - nativeOrder(bb); - return bb; - } - - public static ByteBuffer newByteBuffer(byte[] values, int offset, int len) { - ByteBuffer bb = newByteBuffer(len); - bb.put(values, offset, len); - bb.rewind(); - return bb; - } - - public static ByteBuffer newByteBuffer(byte[] values, int offset) { - return newByteBuffer(values, offset, values.length-offset); - } - - public static ByteBuffer newByteBuffer(byte[] values) { - return newByteBuffer(values, 0); - } - - - /** Allocates a new direct DoubleBuffer with the specified number of - elements. The returned buffer will have its byte order set to - the host platform's native byte order. */ - public static DoubleBuffer newDoubleBuffer(int numElements) { - ByteBuffer bb = newByteBuffer(numElements * SIZEOF_DOUBLE); - return bb.asDoubleBuffer(); - } - - public static DoubleBuffer newDoubleBuffer(double[] values, int offset) { - int len = values.length-offset; - DoubleBuffer bb = newDoubleBuffer(len); - bb.put(values, offset, len); - bb.rewind(); - return bb; - } - - public static DoubleBuffer newDoubleBuffer(double[] values) { - return newDoubleBuffer(values, 0); - } - - - /** Allocates a new direct FloatBuffer with the specified number of - elements. The returned buffer will have its byte order set to - the host platform's native byte order. */ - public static FloatBuffer newFloatBuffer(int numElements) { - ByteBuffer bb = newByteBuffer(numElements * SIZEOF_FLOAT); - return bb.asFloatBuffer(); - } - - public static FloatBuffer newFloatBuffer(float[] values, int offset, int len) { - FloatBuffer bb = newFloatBuffer(len); - bb.put(values, offset, len); - bb.rewind(); - return bb; - } - - public static FloatBuffer newFloatBuffer(float[] values, int offset) { - return newFloatBuffer(values, 0, values.length-offset); - } - - public static FloatBuffer newFloatBuffer(float[] values) { - return newFloatBuffer(values, 0); - } - - - /** Allocates a new direct IntBuffer with the specified number of - elements. The returned buffer will have its byte order set to - the host platform's native byte order. */ - public static IntBuffer newIntBuffer(int numElements) { - ByteBuffer bb = newByteBuffer(numElements * SIZEOF_INT); - return bb.asIntBuffer(); - } - - public static IntBuffer newIntBuffer(int[] values, int offset, int len) { - IntBuffer bb = newIntBuffer(len); - bb.put(values, offset, len); - bb.rewind(); - return bb; - } - - public static IntBuffer newIntBuffer(int[] values, int offset) { - return newIntBuffer(values, 0, values.length-offset); - } - - public static IntBuffer newIntBuffer(int[] values) { - return newIntBuffer(values, 0); - } - - /** Allocates a new direct LongBuffer with the specified number of - elements. The returned buffer will have its byte order set to - the host platform's native byte order. */ - public static LongBuffer newLongBuffer(int numElements) { - ByteBuffer bb = newByteBuffer(numElements * SIZEOF_LONG); - return bb.asLongBuffer(); - } - - /** Allocates a new direct ShortBuffer with the specified number of - elements. The returned buffer will have its byte order set to - the host platform's native byte order. */ - public static ShortBuffer newShortBuffer(int numElements) { - ByteBuffer bb = newByteBuffer(numElements * SIZEOF_SHORT); - return bb.asShortBuffer(); - } - - public static ShortBuffer newShortBuffer(short[] values, int offset, int len) { - ShortBuffer bb = newShortBuffer(len); - bb.put(values, offset, len); - bb.rewind(); - return bb; - } - - public static ShortBuffer newShortBuffer(short[] values, int offset) { - return newShortBuffer(values, 0, values.length-offset); - } - - public static ShortBuffer newShortBuffer(short[] values) { - return newShortBuffer(values, 0); - } - - //---------------------------------------------------------------------- - // Copy routines (type-to-type) - // - - /** Copies the <i>remaining</i> elements (as defined by - <code>limit() - position()</code>) in the passed ByteBuffer into - a newly-allocated direct ByteBuffer. The returned buffer will - have its byte order set to the host platform's native byte - order. The position of the newly-allocated buffer will be zero, - and the position of the passed buffer is unchanged (though its - mark is changed). */ - public static ByteBuffer copyByteBuffer(ByteBuffer orig) { - ByteBuffer dest = newByteBuffer(orig.remaining()); - dest.put(orig); - dest.rewind(); - return dest; - } - - /** Copies the <i>remaining</i> elements (as defined by - <code>limit() - position()</code>) in the passed FloatBuffer - into a newly-allocated direct FloatBuffer. The returned buffer - will have its byte order set to the host platform's native byte - order. The position of the newly-allocated buffer will be zero, - and the position of the passed buffer is unchanged (though its - mark is changed). */ - public static FloatBuffer copyFloatBuffer(FloatBuffer orig) { - return copyFloatBufferAsByteBuffer(orig).asFloatBuffer(); - } - - /** Copies the <i>remaining</i> elements (as defined by - <code>limit() - position()</code>) in the passed IntBuffer - into a newly-allocated direct IntBuffer. The returned buffer - will have its byte order set to the host platform's native byte - order. The position of the newly-allocated buffer will be zero, - and the position of the passed buffer is unchanged (though its - mark is changed). */ - public static IntBuffer copyIntBuffer(IntBuffer orig) { - return copyIntBufferAsByteBuffer(orig).asIntBuffer(); - } - - /** Copies the <i>remaining</i> elements (as defined by - <code>limit() - position()</code>) in the passed ShortBuffer - into a newly-allocated direct ShortBuffer. The returned buffer - will have its byte order set to the host platform's native byte - order. The position of the newly-allocated buffer will be zero, - and the position of the passed buffer is unchanged (though its - mark is changed). */ - public static ShortBuffer copyShortBuffer(ShortBuffer orig) { - return copyShortBufferAsByteBuffer(orig).asShortBuffer(); - } - - //---------------------------------------------------------------------- - // Copy routines (type-to-ByteBuffer) - // - - /** Copies the <i>remaining</i> elements (as defined by - <code>limit() - position()</code>) in the passed FloatBuffer - into a newly-allocated direct ByteBuffer. The returned buffer - will have its byte order set to the host platform's native byte - order. The position of the newly-allocated buffer will be zero, - and the position of the passed buffer is unchanged (though its - mark is changed). */ - public static ByteBuffer copyFloatBufferAsByteBuffer(FloatBuffer orig) { - ByteBuffer dest = newByteBuffer(orig.remaining() * SIZEOF_FLOAT); - dest.asFloatBuffer().put(orig); - dest.rewind(); - return dest; - } - - /** Copies the <i>remaining</i> elements (as defined by - <code>limit() - position()</code>) in the passed IntBuffer into - a newly-allocated direct ByteBuffer. The returned buffer will - have its byte order set to the host platform's native byte - order. The position of the newly-allocated buffer will be zero, - and the position of the passed buffer is unchanged (though its - mark is changed). */ - public static ByteBuffer copyIntBufferAsByteBuffer(IntBuffer orig) { - ByteBuffer dest = newByteBuffer(orig.remaining() * SIZEOF_INT); - dest.asIntBuffer().put(orig); - dest.rewind(); - return dest; - } - - /** Copies the <i>remaining</i> elements (as defined by - <code>limit() - position()</code>) in the passed ShortBuffer - into a newly-allocated direct ByteBuffer. The returned buffer - will have its byte order set to the host platform's native byte - order. The position of the newly-allocated buffer will be zero, - and the position of the passed buffer is unchanged (though its - mark is changed). */ - public static ByteBuffer copyShortBufferAsByteBuffer(ShortBuffer orig) { - ByteBuffer dest = newByteBuffer(orig.remaining() * SIZEOF_SHORT); - dest.asShortBuffer().put(orig); - dest.rewind(); - return dest; - } - - //---------------------------------------------------------------------- - // Conversion routines - // - - public final static float[] getFloatArray(double[] source) { - int i=source.length; - float[] dest = new float[i--]; - while(i>=0) { dest[i]=(float)source[i]; i--; } - return dest; - } - - public final static FloatBuffer getFloatBuffer(DoubleBuffer source) { - source.rewind(); - FloatBuffer dest = BufferUtil.newFloatBuffer(source.limit()); - while(source.hasRemaining()) { dest.put((float)source.get()); } - return dest; - } - - public static ByteBuffer nativeOrder(ByteBuffer buf) { - if (!isCDCFP) { - try { - if (byteOrderClass == null) { - byteOrderClass = Class.forName("java.nio.ByteOrder"); - orderMethod = ByteBuffer.class.getMethod("order", new Class[] { byteOrderClass }); - Method nativeOrderMethod = byteOrderClass.getMethod("nativeOrder", null); - nativeOrderObject = nativeOrderMethod.invoke(null, null); - } - } catch (Throwable t) { - // Must be running on CDC / FP - isCDCFP = true; - } - - if (!isCDCFP) { - try { - orderMethod.invoke(buf, new Object[] { nativeOrderObject }); - } catch (Throwable t) { - } - } - } - return buf; - } - - //---------------------------------------------------------------------- - // Convenient GL put methods with generic target Buffer - // - public static void put(Buffer dest, Buffer v) { - if((dest instanceof ByteBuffer) && (v instanceof ByteBuffer)) { - ((ByteBuffer)dest).put((ByteBuffer)v); - } else if((dest instanceof ShortBuffer) && (v instanceof ShortBuffer)) { - ((ShortBuffer)dest).put((ShortBuffer)v); - } else if((dest instanceof IntBuffer) && (v instanceof IntBuffer)) { - ((IntBuffer)dest).put((IntBuffer)v); - } else if((dest instanceof FloatBuffer) && (v instanceof FloatBuffer)) { - ((FloatBuffer)dest).put((FloatBuffer)v); - } else { - throw new GLException("Incompatible Buffer classes: dest = "+dest.getClass().getName() + ", src = " + v.getClass().getName()); - } - } - - public static void putb(Buffer dest, byte v) { - if(dest instanceof ByteBuffer) { - ((ByteBuffer)dest).put(v); - } else if(dest instanceof ShortBuffer) { - ((ShortBuffer)dest).put((short)v); - } else if(dest instanceof IntBuffer) { - ((IntBuffer)dest).put((int)v); - } else { - throw new GLException("Byte doesn't match Buffer Class: "+dest); - } - } - - public static void puts(Buffer dest, short v) { - if(dest instanceof ShortBuffer) { - ((ShortBuffer)dest).put(v); - } else if(dest instanceof IntBuffer) { - ((IntBuffer)dest).put((int)v); - } else { - throw new GLException("Short doesn't match Buffer Class: "+dest); - } - } - - public static void puti(Buffer dest, int v) { - if(dest instanceof IntBuffer) { - ((IntBuffer)dest).put(v); - } else { - throw new GLException("Integer doesn't match Buffer Class: "+dest); - } - } - - public static void putx(Buffer dest, int v) { - puti(dest, v); - } - - public static void putf(Buffer dest, float v) { - if(dest instanceof FloatBuffer) { - ((FloatBuffer)dest).put(v); - } else if(dest instanceof IntBuffer) { - ((IntBuffer)dest).put(FixedPoint.toFixed(v)); - } else { - throw new GLException("Float doesn't match Buffer Class: "+dest); - } - } - - public static void putd(Buffer dest, double v) { - if(dest instanceof FloatBuffer) { - ((FloatBuffer)dest).put((float)v); - } else { - throw new GLException("Double doesn't match Buffer Class: "+dest); - } - } - - //---------------------------------------------------------------------- - // Internals only below this point - // - - // NOTE that this work must be done reflectively at the present time - // because this code must compile and run correctly on both CDC/FP and J2SE - private static boolean isCDCFP; - private static Class byteOrderClass; - private static Object nativeOrderObject; - private static Method orderMethod; - -} diff --git a/src/jogl/classes/javax/media/opengl/DefaultGLCapabilitiesChooser.java b/src/jogl/classes/javax/media/opengl/DefaultGLCapabilitiesChooser.java index 5450e400b..ee41c9161 100644 --- a/src/jogl/classes/javax/media/opengl/DefaultGLCapabilitiesChooser.java +++ b/src/jogl/classes/javax/media/opengl/DefaultGLCapabilitiesChooser.java @@ -41,7 +41,7 @@ package javax.media.opengl; import javax.media.nativewindow.Capabilities; import javax.media.nativewindow.NativeWindowException; -import com.sun.opengl.impl.Debug; +import com.jogamp.opengl.impl.Debug; /** <P> The default implementation of the {@link GLCapabilitiesChooser} interface, which provides consistent visual @@ -89,11 +89,17 @@ public class DefaultGLCapabilitiesChooser implements GLCapabilitiesChooser { int windowSystemRecommendedChoice) { GLCapabilities _desired = (GLCapabilities) desired; GLCapabilities[] _available = (GLCapabilities[]) available; + int availnum = 0; + + for (int i = 0; i < _available.length; i++) { + if(null != _available[i]) { availnum++; } + } 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("Available " + i + ": " + _available[i]); + System.err.println(i + ": " + _available[i]); } System.err.println("Window system's recommended choice: " + windowSystemRecommendedChoice); } @@ -132,6 +138,9 @@ public class DefaultGLCapabilitiesChooser implements GLCapabilitiesChooser { if (_desired.isOnscreen() != cur.isOnscreen()) { continue; } + if (!_desired.isOnscreen() && _desired.isPBuffer() && !cur.isPBuffer()) { + continue; // only skip if requested Offscreen && PBuffer, but no PBuffer available + } if (_desired.getStereo() != cur.getStereo()) { continue; } diff --git a/src/jogl/classes/javax/media/opengl/GLArrayData.java b/src/jogl/classes/javax/media/opengl/GLArrayData.java index d17ee6a06..088c71bd8 100644 --- a/src/jogl/classes/javax/media/opengl/GLArrayData.java +++ b/src/jogl/classes/javax/media/opengl/GLArrayData.java @@ -21,10 +21,10 @@ public interface GLArrayData { * The index of the predefined array index, see list below, * or -1 in case of a shader attribute array. * - * @see javax.media.opengl.GL#GL_VERTEX_ARRAY - * @see javax.media.opengl.GL#GL_NORMAL_ARRAY - * @see javax.media.opengl.GL#GL_COLOR_ARRAY - * @see javax.media.opengl.GL#GL_TEXTURE_COORD_ARRAY + * @see javax.media.opengl.GL2#GL_VERTEX_ARRAY + * @see javax.media.opengl.GL2#GL_NORMAL_ARRAY + * @see javax.media.opengl.GL2#GL_COLOR_ARRAY + * @see javax.media.opengl.GL2#GL_TEXTURE_COORD_ARRAY */ public int getIndex(); @@ -49,7 +49,7 @@ public interface GLArrayData { * Sets the determined location of the shader attribute * This is usually done within ShaderState. * - * @see javax.media.opengl.glsl.ShaderState#glVertexAttribPointer(GL2ES2, GLArrayData) + * @see com.jogamp.opengl.util.glsl.ShaderState#glVertexAttribPointer(GL2ES2, GLArrayData) */ public void setLocation(int v); diff --git a/src/jogl/classes/javax/media/opengl/GLAutoDrawable.java b/src/jogl/classes/javax/media/opengl/GLAutoDrawable.java index a94c14f33..7342369d9 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 javax.media.opengl.glu.*; -import com.sun.opengl.impl.Debug; +import com.jogamp.opengl.impl.Debug; import java.security.*; /** A higher-level abstraction than {@link GLDrawable} which supplies diff --git a/src/jogl/classes/javax/media/opengl/GLBase.java b/src/jogl/classes/javax/media/opengl/GLBase.java index be5a6dc4f..5ba410a61 100644 --- a/src/jogl/classes/javax/media/opengl/GLBase.java +++ b/src/jogl/classes/javax/media/opengl/GLBase.java @@ -64,6 +64,20 @@ public interface GLBase { public boolean isGL(); /** + * Indicates whether this GL object conforms to the GL4 compatibility profile. + * The GL4 compatibility profile merges the GL2 profile and GL4 core profile. + * @return whether this GL object conforms to the GL4 compatibility profile + */ + public boolean isGL4bc(); + + /** + * Indicates whether this GL object conforms to the GL4 core profile. + * The GL4 core profile reflects OpenGL versions greater or equal 3.1 + * @return whether this GL object conforms to the GL4 core profile + */ + public boolean isGL4(); + + /** * Indicates whether this GL object conforms to the GL3 compatibility profile. * The GL3 compatibility profile merges the GL2 profile and GL3 core profile. * @return whether this GL object conforms to the GL3 compatibility profile @@ -131,6 +145,20 @@ public interface GLBase { public GL getGL() throws GLException; /** + * Casts this object to the GL4bc interface. + * @return this object cast to the GL4bc interface + * @throws GLException if this GLObject is not a GL4bc implementation + */ + public GL4bc getGL4bc() throws GLException; + + /** + * Casts this object to the GL4 interface. + * @return this object cast to the GL4 interface + * @throws GLException if this GLObject is not a GL4 implementation + */ + public GL4 getGL4() throws GLException; + + /** * Casts this object to the GL3bc interface. * @return this object cast to the GL3bc interface * @throws GLException if this GLObject is not a GL3bc implementation @@ -220,7 +248,7 @@ public interface GLBase { * * @param glFunctionName the name of the OpenGL function (e.g., use * "glBindRenderbufferEXT" or "glBindRenderbuffer" to check if {@link - * #glBindRenderbuffer(int,int)} is available). + * GL#glBindRenderbuffer(int,int)} is available). */ public boolean isFunctionAvailable(String glFunctionName); diff --git a/src/jogl/classes/javax/media/opengl/GLContext.java b/src/jogl/classes/javax/media/opengl/GLContext.java index 840de4764..2709dd506 100644 --- a/src/jogl/classes/javax/media/opengl/GLContext.java +++ b/src/jogl/classes/javax/media/opengl/GLContext.java @@ -39,8 +39,8 @@ package javax.media.opengl; -import com.sun.opengl.impl.Debug; import java.util.HashMap; +import com.jogamp.common.util.IntIntHashMap; /** Abstraction for an OpenGL rendering context. In order to perform OpenGL rendering, a context must be "made current" on the current @@ -67,6 +67,8 @@ public abstract class GLContext { private HashMap/*<int, Object>*/ attachedObjects = new HashMap(); + protected long context; + /** * Returns the GLDrawable to which this context may be used to * draw. @@ -136,14 +138,14 @@ public abstract class GLContext { * copied. <code>mask</code> contains the bitwise OR of the same * symbolic names that are passed to the GL command {@link * GL#glPushAttrib glPushAttrib}. The single symbolic constant - * {@link GL#GL_ALL_ATTRIB_BITS GL_ALL_ATTRIB_BITS} can be used to + * {@link GL2#GL_ALL_ATTRIB_BITS GL_ALL_ATTRIB_BITS} can be used to * copy the maximum possible portion of rendering state. <P> * * Not all values for GL state can be copied. For example, pixel * pack and unpack state, render mode state, and select and feedback * state are not copied. The state that can be copied is exactly the * state that is manipulated by the GL command {@link - * GL#glPushAttrib glPushAttrib}. <P> + * GL2#glPushAttrib glPushAttrib}. <P> * * On most platforms, this context may not be current to any thread, * including the calling thread, when this method is called. Some @@ -164,7 +166,7 @@ public abstract class GLContext { * If no context is current, throw an GLException * * @return the current context's GL object on this thread - * @thows GLException if no context is current + * @throws GLException if no context is current */ public static GL getCurrentGL() throws GLException { GLContext glc = getCurrent(); @@ -259,7 +261,15 @@ public abstract class GLContext { public final String toString() { StringBuffer sb = new StringBuffer(); sb.append(getClass().getName()); - sb.append(" ["); + sb.append(" [OpenGL "); + sb.append(getGLVersionMajor()); + sb.append("."); + sb.append(getGLVersionMinor()); + sb.append(", options 0x"); + sb.append(Integer.toHexString(ctxOptions)); + sb.append(", "); + sb.append(getGLVersion()); + sb.append(", "); sb.append(getGL()); if(getGLDrawable()!=getGLDrawableRead()) { sb.append(",\n\tDrawable Read : "); @@ -279,4 +289,241 @@ public abstract class GLContext { GLX) extensions. Can only be called while this context is current. */ public abstract String getPlatformExtensionsString(); + + public final int getGLVersionMajor() { return ctxMajorVersion; } + public final int getGLVersionMinor() { return ctxMinorVersion; } + public final boolean isGLCompatibilityProfile() { return ( 0 != ( CTX_PROFILE_COMPAT & ctxOptions ) ); } + public final boolean isGLForwardCompatible() { return ( 0 != ( CTX_OPTION_FORWARD & ctxOptions ) ); } + public final boolean isCreatedWithARBMethod() { return ( 0 != ( CTX_IS_ARB_CREATED & ctxOptions ) ); } + + /** + * Returns a valid OpenGL version string, ie + * <code>major.minor ([option]?[options,]*) - gl-version</code> + * + * <ul> + * <li> options + * <ul> + * <li> <code>old</code> refers to the non ARB_create_context created context + * <li> <code>new</code> refers to the ARB_create_context created context + * <li> <code>compatible profile</code> + * <li> <code>core profile</code> + * <li> <code>forward compatible</code> + * <li> <code>any</code> refers to the non forward compatible context + * <li> <code>ES</code> refers to the GLES context variant + * </ul> + * <li> <i>gl-version</i> the GL_VERSION string + * </ul> + * + * e.g.: + * <table border="0"> + * <tr> <td></td> <td></td> </tr> + * <tr> + * <td>row 2, cell 1</td> + * <td>row 2, cell 2</td> + * </tr> + * </table> + * + * <table border="0"> + * <tr><td></td> <td>ES2</td> <td><code>2.0 (ES, any, new) - 2.0 ES Profile</code></td></tr> + * <tr><td>ATI</td><td>GL2</td> <td><code>3.0 (compatibility profile, any, new) - 3.2.9704 Compatibility Profile Context</code></td></tr> + * <tr><td>ATI</td><td>GL3</td> <td><code>3.3 (core profile, any, new) - 1.4 (3.2.9704 Compatibility Profile Context)</code></td></tr> + * <tr><td>ATI</td><td>GL3bc</td><td><code>3.3 (compatibility profile, any, new) - 1.4 (3.2.9704 Compatibility Profile Context)</code></td></tr> + * <tr><td>NV</td><td>GL2</td> <td><code>3.0 (compatibility profile, any, new) - 3.0.0 NVIDIA 195.36.07.03</code></td></tr> + * <tr><td>NV</td><td>GL3</td> <td><code>3.3 (core profile, any, new) - 3.3.0 NVIDIA 195.36.07.03</code></td></tr> + * <tr><td>NV</td><td>GL3bc</td> <td><code>3.3 (compatibility profile, any, new) - 3.3.0 NVIDIA 195.36.07.03</code></td></tr> + * </table> + */ + public final String getGLVersion() { + return ctxVersionString; + } + + protected int ctxMajorVersion=-1; + protected int ctxMinorVersion=-1; + protected int ctxOptions=0; + protected String ctxVersionString=null; + + /** <code>ARB_create_context</code> related: created via ARB_create_context */ + protected static final int CTX_IS_ARB_CREATED = 1 << 0; + /** <code>ARB_create_context</code> related: compatibility profile */ + protected static final int CTX_PROFILE_COMPAT = 1 << 1; + /** <code>ARB_create_context</code> related: core profile */ + protected static final int CTX_PROFILE_CORE = 1 << 2; + /** <code>ARB_create_context</code> related: flag forward compatible */ + protected static final int CTX_PROFILE_ES = 1 << 3; + /** <code>ARB_create_context</code> related: flag forward compatible */ + protected static final int CTX_OPTION_FORWARD = 1 << 4; + /** <code>ARB_create_context</code> related: not flag forward compatible */ + protected static final int CTX_OPTION_ANY = 1 << 5; + /** <code>ARB_create_context</code> related: flag debug */ + protected static final int CTX_OPTION_DEBUG = 1 << 6; + + + public final boolean isGL4bc() { + return ctxMajorVersion>=4 && CTX_PROFILE_COMPAT==(ctxOptions & (CTX_PROFILE_COMPAT|CTX_PROFILE_ES)); + } + + public final boolean isGL4() { + return ctxMajorVersion>=4 && 0==(ctxOptions & (CTX_PROFILE_ES)); + } + + public final boolean isGL3bc() { + return ctxMajorVersion>=3 && CTX_PROFILE_COMPAT==(ctxOptions & (CTX_PROFILE_COMPAT|CTX_PROFILE_ES)); + } + + public final boolean isGL3() { + return ctxMajorVersion>=3 && 0==(ctxOptions & (CTX_PROFILE_ES)); + } + + public final boolean isGL2() { + return ctxMajorVersion>=1 && CTX_PROFILE_COMPAT==(ctxOptions & (CTX_PROFILE_COMPAT|CTX_PROFILE_ES)); + } + + public final boolean isGL2GL3() { + return isGL2() || isGL3(); + } + + public final boolean isGLES1() { + return ctxMajorVersion==1 && CTX_PROFILE_ES==(ctxOptions & CTX_PROFILE_ES); + } + + public final boolean isGLES2() { + return ctxMajorVersion==2 && CTX_PROFILE_ES==(ctxOptions & CTX_PROFILE_ES); + } + + public final boolean isGLES() { + return CTX_PROFILE_ES==(ctxOptions & CTX_PROFILE_ES); + } + + public final boolean isGL2ES1() { + return isGL2() || isGLES1() ; + } + + public final boolean isGL2ES2() { + return isGL2GL3() || isGLES2() ; + } + + public final boolean hasGLSL() { + return isGL2ES2() ; + } + + public static final int GL_VERSIONS[][] = { + /* 0.*/ { -1 }, + /* 1.*/ { 0, 1, 2, 3, 4, 5 }, + /* 2.*/ { 0, 1 }, + /* 3.*/ { 0, 1, 2, 3 }, + /* 4.*/ { 0 } }; + + public static final int getMaxMajor() { + return GL_VERSIONS.length-1; + } + + public static final int getMaxMinor(int major) { + if(1>major || major>=GL_VERSIONS.length) return -1; + return GL_VERSIONS[major].length-1; + } + + public static final boolean isValidGLVersion(int major, int minor) { + if(1>major || major>=GL_VERSIONS.length) return false; + if(0>minor || minor>=GL_VERSIONS[major].length) return false; + return true; + } + + public static final boolean decrementGLVersion(int major[], int minor[]) { + if(null==major || major.length<1 ||null==minor || minor.length<1) { + throw new GLException("invalid array arguments"); + } + int m = major[0]; + int n = minor[0]; + if(!isValidGLVersion(m, n)) return false; + + // decrement .. + n -= 1; + if(n < 0) { + m -= 1; + n = GL_VERSIONS[m].length-1; + } + if(!isValidGLVersion(m, n)) return false; + major[0]=m; + minor[0]=n; + + return true; + } + + public static final boolean isGLVersionAvailable(int major, boolean compatibility) { + int key = compose8bit(major, compatibility?CTX_PROFILE_COMPAT:CTX_PROFILE_CORE, 0, 0); + int val = mappedVersionsAvailable.get( key ); + return val>0; + } + public static final boolean isGL4bcAvailable() { return isGLVersionAvailable(4, true); } + public static final boolean isGL4Available() { return isGLVersionAvailable(4, false); } + public static final boolean isGL3bcAvailable() { return isGLVersionAvailable(3, true); } + public static final boolean isGL3Available() { return isGLVersionAvailable(3, false); } + public static final boolean isGL2Available() { return isGLVersionAvailable(2, true); } + + protected static final IntIntHashMap mappedVersionsAvailable; + protected static volatile boolean mappedVersionsAvailableSet; + protected static Object mappedVersionsAvailableLock; + + static { + mappedVersionsAvailableLock = new Object(); + mappedVersionsAvailableSet = false; + mappedVersionsAvailable = new IntIntHashMap(); + mappedVersionsAvailable.setKeyNotFoundValue(-1); + } + + /** + * Called by {@link GLContextImpl#createContextARBMapVersionsAvailable} not intendet to be used by + * implementations. However, if {@link #createContextARB} is not being used within the + * {@link GLDrawableImpl} constructor, GLProfile has to map the available versions. + * + * @see #createContextARBMapVersionsAvailable + */ + protected static void mapVersionAvailable(int reqMajor, boolean reqCompat, int resMajor, int resMinor, int resCtp) + { + int key = compose8bit(reqMajor, reqCompat?CTX_PROFILE_COMPAT:CTX_PROFILE_CORE, 0, 0); + int val = compose8bit(resMajor, resMinor, resCtp, 0); + mappedVersionsAvailable.put( key, val ); + } + + protected static int compose8bit(int one, int two, int three, int four) { + return ( ( one & 0x000000FF ) << 24 ) | + ( ( two & 0x000000FF ) << 16 ) | + ( ( three & 0x000000FF ) << 8 ) | + ( ( four & 0x000000FF ) ) ; + } + + protected static int getComposed8bit(int bits32, int which ) { + switch (which) { + case 1: return ( bits32 & 0xFF000000 ) >> 24 ; + case 2: return ( bits32 & 0x00FF0000 ) >> 16 ; + case 3: return ( bits32 & 0x0000FF00 ) >> 8 ; + case 4: return ( bits32 & 0xFF0000FF ) ; + } + throw new GLException("argument which out of range: "+which); + } + + protected static String composed8BitToString(int bits32, boolean hex1, boolean hex2, boolean hex3, boolean hex4) { + int a = getComposed8bit(bits32, 1); + int b = getComposed8bit(bits32, 2); + int c = getComposed8bit(bits32, 3); + int d = getComposed8bit(bits32, 4); + return "["+toString(a, hex1)+", "+toString(b, hex2)+", "+toString(c, hex3)+", "+toString(d, hex4)+"]"; + } + + protected static String toString(int val, boolean hex) { + if(hex) { + return "0x" + Integer.toHexString(val); + } + return String.valueOf(val); + } + + protected static String toHexString(int hex) { + return "0x" + Integer.toHexString(hex); + } + + protected static String toHexString(long hex) { + return "0x" + Long.toHexString(hex); + } + } + diff --git a/src/jogl/classes/javax/media/opengl/GLDrawableFactory.java b/src/jogl/classes/javax/media/opengl/GLDrawableFactory.java index b7c81cbed..b02bffb61 100644 --- a/src/jogl/classes/javax/media/opengl/GLDrawableFactory.java +++ b/src/jogl/classes/javax/media/opengl/GLDrawableFactory.java @@ -41,10 +41,10 @@ package javax.media.opengl; import javax.media.nativewindow.*; -import java.lang.reflect.*; import java.security.*; -import com.sun.opengl.impl.*; -import com.sun.nativewindow.impl.NWReflection; +import com.jogamp.common.JogampRuntimeException; +import com.jogamp.common.util.*; +import com.jogamp.opengl.impl.*; /** <P> Provides a virtual machine- and operating system-independent mechanism for creating {@link GLDrawable}s. </P> @@ -88,8 +88,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.sun.opengl.impl.macosx.cgl.MacOSXCGLDrawableFactory"; - static final String macosxFactoryClassNameAWTCGL = "com.sun.opengl.impl.macosx.cgl.awt.MacOSXAWTCGLDrawableFactory"; + static final String macosxFactoryClassNameCGL = "com.jogamp.opengl.impl.macosx.cgl.MacOSXCGLDrawableFactory"; + static final String macosxFactoryClassNameAWTCGL = "com.jogamp.opengl.impl.macosx.cgl.awt.MacOSXAWTCGLDrawableFactory"; /** * Instantiate singleton factories if available, EGLES1, EGLES2 and the OS native ones. @@ -97,51 +97,50 @@ public abstract class GLDrawableFactory { static { GLDrawableFactory tmp = null; try { - tmp = (GLDrawableFactory) NWReflection.createInstance("com.sun.opengl.impl.egl.EGLDrawableFactory"); - } catch (Throwable t) { + tmp = (GLDrawableFactory) ReflectionUtil.createInstance("com.jogamp.opengl.impl.egl.EGLDrawableFactory"); + } catch (JogampRuntimeException jre) { if (GLProfile.DEBUG) { System.err.println("GLDrawableFactory.static - EGLDrawableFactory - not available"); - t.printStackTrace(); + jre.printStackTrace(); } } eglFactory = tmp; nativeOSType = NativeWindowFactory.getNativeWindowType(true); - String factoryClassName = null; tmp = null; - try { - factoryClassName = Debug.getProperty("jogl.gldrawablefactory.class.name", true, AccessController.getContext()); - if (null == factoryClassName) { - if ( nativeOSType.equals(NativeWindowFactory.TYPE_X11) ) { - factoryClassName = "com.sun.opengl.impl.x11.glx.X11GLXDrawableFactory"; - } else if ( nativeOSType.equals(NativeWindowFactory.TYPE_WINDOWS) ) { - factoryClassName = "com.sun.opengl.impl.windows.wgl.WindowsWGLDrawableFactory"; - } else if ( nativeOSType.equals(NativeWindowFactory.TYPE_MACOSX) ) { - if(NWReflection.isClassAvailable(macosxFactoryClassNameAWTCGL)) { - factoryClassName = macosxFactoryClassNameAWTCGL; - } else { - factoryClassName = macosxFactoryClassNameCGL; - } + String factoryClassName = Debug.getProperty("jogl.gldrawablefactory.class.name", true, AccessController.getContext()); + if (null == factoryClassName) { + if ( nativeOSType.equals(NativeWindowFactory.TYPE_X11) ) { + factoryClassName = "com.jogamp.opengl.impl.x11.glx.X11GLXDrawableFactory"; + } else if ( nativeOSType.equals(NativeWindowFactory.TYPE_WINDOWS) ) { + factoryClassName = "com.jogamp.opengl.impl.windows.wgl.WindowsWGLDrawableFactory"; + } else if ( nativeOSType.equals(NativeWindowFactory.TYPE_MACOSX) ) { + if(ReflectionUtil.isClassAvailable(macosxFactoryClassNameAWTCGL)) { + factoryClassName = macosxFactoryClassNameAWTCGL; } else { - // may use egl*Factory .. - if (GLProfile.DEBUG) { - System.err.println("GLDrawableFactory.static - No native OS Factory for: "+nativeOSType+"; May use EGLDrawableFactory, if available." ); - } + factoryClassName = macosxFactoryClassNameCGL; } - } - if (null != factoryClassName) { + } else { + // may use egl*Factory .. if (GLProfile.DEBUG) { - System.err.println("GLDrawableFactory.static - Native OS Factory for: "+nativeOSType+": "+factoryClassName); + System.err.println("GLDrawableFactory.static - No native OS Factory for: "+nativeOSType+"; May use EGLDrawableFactory, if available." ); } - tmp = (GLDrawableFactory) NWReflection.createInstance(factoryClassName); - } - } catch (Throwable t) { - if (GLProfile.DEBUG) { - System.err.println("GLDrawableFactory.static - Native Platform: "+nativeOSType+" - not available: "+factoryClassName); - t.printStackTrace(); } } + if (null != factoryClassName) { + if (GLProfile.DEBUG) { + System.err.println("GLDrawableFactory.static - Native OS Factory for: "+nativeOSType+": "+factoryClassName); + } + try { + tmp = (GLDrawableFactory) ReflectionUtil.createInstance(factoryClassName); + } catch (JogampRuntimeException jre) { + if (GLProfile.DEBUG) { + System.err.println("GLDrawableFactory.static - Native Platform: "+nativeOSType+" - not available: "+factoryClassName); + jre.printStackTrace(); + } + } + } nativeOSFactory = tmp; } @@ -174,8 +173,7 @@ public abstract class GLDrawableFactory { destroy any GLContexts and GLDrawables that have been created and are still in use. No further OpenGL calls may be made after shutting down the GLDrawableFactory. */ - public void shutdown() { - } + public abstract void shutdown(); //---------------------------------------------------------------------- // Methods to create high-level objects @@ -187,10 +185,10 @@ public abstract class GLDrawableFactory { * The native platform's chosen Capabilties are referenced within the target * NativeWindow's AbstractGraphicsConfiguration.<p> * - * In case {@link javax.media.nativewindow.Capabilties#isOnscreen()} is true,<br> + * In case {@link javax.media.nativewindow.Capabilities#isOnscreen()} is true,<br> * an onscreen GLDrawable will be realized. * <p> - * In case {@link javax.media.nativewindow.Capabilties#isOnscreen()} is false,<br> + * 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> * <p> @@ -218,8 +216,9 @@ public abstract class GLDrawableFactory { /** * 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 */ - public abstract boolean canCreateGLPbuffer(); + public abstract boolean canCreateGLPbuffer(AbstractGraphicsDevice device); /** * Creates a Pbuffer GLDrawable with the given capabilites and dimensions. <P> @@ -280,8 +279,9 @@ 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 */ - public abstract boolean canCreateExternalGLDrawable(); + public abstract boolean canCreateExternalGLDrawable(AbstractGraphicsDevice device); /** * <P> Creates a {@link GLDrawable} object representing an existing diff --git a/src/jogl/classes/javax/media/opengl/GLPipelineFactory.java b/src/jogl/classes/javax/media/opengl/GLPipelineFactory.java index 63b50cb3c..352545849 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.sun.opengl.impl.*; +import com.jogamp.opengl.impl.*; /** * 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 69cdd3f24..0e10b32b3 100644 --- a/src/jogl/classes/javax/media/opengl/GLProfile.java +++ b/src/jogl/classes/javax/media/opengl/GLProfile.java @@ -36,13 +36,16 @@ package javax.media.opengl; -import javax.media.opengl.fixedfunc.*; -import java.lang.reflect.*; +import com.jogamp.common.util.*; +import com.jogamp.opengl.impl.DRIHack; +import com.jogamp.opengl.impl.Debug; +import com.jogamp.opengl.impl.GLJNILibLoader; +import com.jogamp.common.jvm.JVMUtil; import java.util.HashMap; -import java.security.*; -import com.sun.opengl.impl.*; -import com.sun.nativewindow.impl.NWReflection; -import com.sun.nativewindow.impl.jvm.JVMUtil; +import java.util.Iterator; +import java.security.AccessControlContext; +import java.security.AccessController; +import javax.media.opengl.fixedfunc.GLPointerFunc; /** * Specifies the the OpenGL profile. @@ -57,9 +60,62 @@ public class GLProfile implements Cloneable { public static final boolean DEBUG = Debug.debug("GLProfile"); // + // Query platform available OpenGL implementation + // + + public static final boolean isGL4bcAvailable() { return null != mappedProfiles.get(GL4bc); } + public static final boolean isGL4Available() { return null != mappedProfiles.get(GL4); } + public static final boolean isGL3bcAvailable() { return null != mappedProfiles.get(GL3bc); } + public static final boolean isGL3Available() { return null != mappedProfiles.get(GL3); } + public static final boolean isGL2Available() { return null != mappedProfiles.get(GL2); } + public static final boolean isGLES2Available() { return null != mappedProfiles.get(GLES2); } + public static final boolean isGLES1Available() { return null != mappedProfiles.get(GLES1); } + public static final boolean isGL2ES1Available() { return null != mappedProfiles.get(GL2ES1); } + public static final boolean isGL2ES2Available() { return null != mappedProfiles.get(GL2ES2); } + + public static final String glAvailabilityToString() { + StringBuffer sb = new StringBuffer(); + sb.append("GLAvailability[Native[GL4bc "); + sb.append(isGL4bcAvailable()); + sb.append(", GL4 "); + sb.append(isGL4Available()); + sb.append(", GL3bc "); + sb.append(isGL3bcAvailable()); + sb.append(", GL3 "); + sb.append(isGL3Available()); + sb.append(", GL2 "); + sb.append(isGL2Available()); + sb.append(", GL2ES1 "); + sb.append(isGL2ES1Available()); + sb.append(", GLES1 "); + sb.append(isGLES1Available()); + sb.append(", GL2ES2 "); + sb.append(isGL2ES2Available()); + sb.append(", GLES2 "); + sb.append(isGLES2Available()); + sb.append("], Profiles["); + for(Iterator i=mappedProfiles.values().iterator(); i.hasNext(); ) { + sb.append(((GLProfile)i.next()).toString()); + sb.append(", "); + } + sb.append(", default "); + sb.append(defaultGLProfile); + sb.append("]]"); + + return sb.toString(); + } + + // // Public (user-visible) profiles // + /** The desktop OpenGL compatibility profile 4.x, with x >= 0, ie GL2 plus GL4.<br> + <code>bc</code> stands for backward compatibility. */ + public static final String GL4bc = "GL4bc"; + + /** The desktop OpenGL core profile 4.x, with x >= 0 */ + public static final String GL4 = "GL4"; + /** The desktop OpenGL compatibility profile 3.x, with x >= 1, ie GL2 plus GL3.<br> <code>bc</code> stands for backward compatibility. */ public static final String GL3bc = "GL3bc"; @@ -86,22 +142,92 @@ public class GLProfile implements Cloneable { public static final String GL2GL3 = "GL2GL3"; /** - * All GL Profiles in the order of default detection: GL2, GL2ES2, GL2ES1, GLES2, GLES1, GL2GL3, GL3 + * 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! + * + * <ul> + * <li> GL2 + * <li> GL3bc + * <li> GL4bc + * <li> GL2GL3 + * <li> GL3 + * <li> GL4 + * <li> GL2ES2 + * <li> GLES2 + * <li> GL2ES1 + * <li> GLES1 + * </ul> + * + */ + public static final String[] GL_PROFILE_LIST_ALL = new String[] { GL2, GL3bc, GL4bc, GL2GL3, GL3, GL4, GL2ES2, GLES2, GL2ES1, GLES1 }; + + /** + * Order of maximum fixed function profiles + * + * <ul> + * <li> GL4bc + * <li> GL3bc + * <li> GL2 + * <li> GL2ES1 + * <li> GLES1 + * </ul> + * + */ + public static final String[] GL_PROFILE_LIST_MAX_FIXEDFUNC = new String[] { GL4bc, GL3bc, GL2, GL2ES1, GLES1 }; + + /** + * Order of maximum programmable shader profiles + * + * <ul> + * <li> GL4 + * <li> GL4bc + * <li> GL3 + * <li> GL3bc + * <li> GL2 + * <li> GL2ES2 + * <li> GLES2 + * </ul> + * */ - public static final String[] GL_PROFILE_LIST_ALL = new String[] { GL2, GL2ES2, GL2ES1, GLES2, GLES1, GL2GL3, GL3bc, GL3 }; + public static final String[] GL_PROFILE_LIST_MAX_PROGSHADER = new String[] { GL4, GL4bc, GL3, GL3bc, GL2, GL2ES2, GLES2 }; /** - * All GL2ES2 Profiles in the order of default detection: GL2ES2, GL2, GLES2, GL3 + * 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 + * <li> GL3 + * <li> GL4 + * <li> GLES2 + * </ul> + * */ - public static final String[] GL_PROFILE_LIST_GL2ES2 = new String[] { GL2ES2, GL2, GLES2, GL3bc, GL3 }; + public static final String[] GL_PROFILE_LIST_GL2ES2 = new String[] { GL2ES2, GL2, GL3, GL4, GLES2 }; /** - * All GL2ES1 Profiles in the order of default detection: GL2ES1, GL2, GLES1 + * 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 + * <li> GL3bc + * <li> GL4bc + * <li> GLES1 + * </ul> + * */ - public static final String[] GL_PROFILE_LIST_GL2ES1 = new String[] { GL2ES1, GL2, GLES1 }; + public static final String[] GL_PROFILE_LIST_GL2ES1 = new String[] { GL2ES1, GL2, GL3bc, GL4bc, 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} + * @see #GL_PROFILE_LIST_ALL */ public static final GLProfile getDefault() { if(null==defaultGLProfile) { @@ -110,22 +236,30 @@ public class GLProfile implements Cloneable { return defaultGLProfile; } - /** Returns a GLProfile object. - * Verfifies the given profile and chooses an apropriate implementation. - * A generic value of <code>null</code> or <code>GL</code> will result in - * the default profile. + /** + * 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. + * @see #GL_PROFILE_LIST_MAX_FIXEDFUNC */ - public static final GLProfile get(String profile) + public static final GLProfile getMaxFixedFunc() throws GLException { - if(null==profile || profile.equals("GL")) return getDefault(); - GLProfile glProfile = (GLProfile) mappedProfiles.get(profile); - if(null==glProfile) { - throw new GLException("No implementation for profile "+profile+" available"); - } - return glProfile; + return get(GL_PROFILE_LIST_MAX_FIXEDFUNC); + } + + /** + * Returns the highest profile, implementing the programmable shader pipeline. + * It selects the first of the set: {@link GLProfile#GL_PROFILE_LIST_MAX_PROGSHADER} + * + * @throws GLException if no implementation for the given profile is found. + * @see #GL_PROFILE_LIST_MAX_PROGSHADER + */ + public static final GLProfile getMaxProgrammable() + throws GLException + { + return get(GL_PROFILE_LIST_MAX_PROGSHADER); } /** @@ -133,6 +267,7 @@ public class GLProfile implements Cloneable { * It selects the first of the set: {@link GLProfile#GL_PROFILE_LIST_GL2ES1} * * @throws GLException if no implementation for the given profile is found. + * @see #GL_PROFILE_LIST_GL2ES1 */ public static final GLProfile getGL2ES1() throws GLException @@ -145,6 +280,7 @@ public class GLProfile implements Cloneable { * It selects the first of the set: {@link GLProfile#GL_PROFILE_LIST_GL2ES2} * * @throws GLException if no implementation for the given profile is found. + * @see #GL_PROFILE_LIST_GL2ES2 */ public static final GLProfile getGL2ES2() throws GLException @@ -152,6 +288,24 @@ public class GLProfile implements Cloneable { return get(GL_PROFILE_LIST_GL2ES2); } + /** Returns a GLProfile object. + * Verfifies the given profile and chooses an apropriate implementation. + * A generic value of <code>null</code> or <code>GL</code> will result in + * the default profile. + * + * @throws GLException if no implementation for the given profile is found. + */ + public static final GLProfile get(String profile) + throws GLException + { + if(null==profile || profile.equals("GL")) return getDefault(); + GLProfile glProfile = (GLProfile) mappedProfiles.get(profile); + if(null==glProfile) { + throw new GLException("No implementation for profile "+profile+" available"); + } + return glProfile; + } + /** * Returns the first profile from the given list, * where an implementation is available. @@ -191,18 +345,18 @@ public class GLProfile implements Cloneable { } private static final String getGLImplBaseClassName(String profileImpl) { - if(GL3bc.equals(profileImpl)) { - return "com.sun.opengl.impl.gl3.GL3bc"; - } else if(GL3.equals(profileImpl)) { - return "com.sun.opengl.impl.gl3.GL3"; - } else if(GL2.equals(profileImpl)) { - return "com.sun.opengl.impl.gl2.GL2"; + if ( GL4bc.equals(profileImpl) || + GL4.equals(profileImpl) || + GL3bc.equals(profileImpl) || + GL3.equals(profileImpl) || + GL2.equals(profileImpl) ) { + return "com.jogamp.opengl.impl.gl4.GL4bc"; } else if(GL2ES12.equals(profileImpl)) { - return "com.sun.opengl.impl.gl2es12.GL2ES12"; + return "com.jogamp.opengl.impl.gl2es12.GL2ES12"; } else if(GLES1.equals(profileImpl) || GL2ES1.equals(profileImpl)) { - return "com.sun.opengl.impl.es1.GLES1"; + return "com.jogamp.opengl.impl.es1.GLES1"; } else if(GLES2.equals(profileImpl) || GL2ES2.equals(profileImpl)) { - return "com.sun.opengl.impl.es2.GLES2"; + return "com.jogamp.opengl.impl.es2.GLES2"; } else { throw new GLException("unsupported profile \"" + profileImpl + "\""); } @@ -252,19 +406,29 @@ public class GLProfile implements Cloneable { return profileImpl; } + /** Indicates whether this profile is capable of GL4bc. */ + public final boolean isGL4bc() { + return GL4bc.equals(profile); + } + + /** Indicates whether this profile is capable of GL4. */ + public final boolean isGL4() { + return isGL4bc() || GL4.equals(profile); + } + /** Indicates whether this profile is capable of GL3bc. */ public final boolean isGL3bc() { - return GL3bc.equals(profile); + return isGL4bc() || GL3bc.equals(profile); } /** Indicates whether this profile is capable of GL3. */ public final boolean isGL3() { - return isGL3bc() || GL3.equals(profile); + return isGL4() || isGL3bc() || GL3.equals(profile); } - /** Indicates whether this profile is capable of GL2. */ + /** Indicates whether this context is a GL2 context */ public final boolean isGL2() { - return GL2.equals(profile); + return isGL3bc() || GL2.equals(profile); } /** Indicates whether this profile is capable of GLES1. */ @@ -292,6 +456,11 @@ public class GLProfile implements Cloneable { return GL2GL3.equals(profile) || isGL2() || isGL3() ; } + /** Indicates whether this profile supports GLSL. */ + public final boolean hasGLSL() { + return isGL2ES2() ; + } + /** Indicates whether this profile uses the native OpenGL ES1 implementations. */ public final boolean usesNativeGLES1() { return GLES1.equals(profileImpl); @@ -307,31 +476,6 @@ public class GLProfile implements Cloneable { return usesNativeGLES2() || usesNativeGLES1(); } - /** Indicates whether this profile uses the native desktop OpenGL GL2 implementations. */ - public final boolean usesNativeGL2() { - return GL2.equals(profileImpl) || GL2ES12.equals(profileImpl) ; - } - - /** Indicates whether this profile uses the native desktop OpenGL GL3bc implementations. */ - public final boolean usesNativeGL3bc() { - return GL3bc.equals(profileImpl); - } - - /** Indicates whether this profile uses the native desktop OpenGL GL3 implementations. */ - public final boolean usesNativeGL3() { - return usesNativeGL3bc() || GL3.equals(profileImpl); - } - - /** Indicates whether this profile uses the native desktop OpenGL GL2 or GL3 implementations. */ - public final boolean usesNativeGL2GL3() { - return usesNativeGL2() || usesNativeGL3() ; - } - - /** Indicates whether this profile supports GLSL. */ - public final boolean hasGLSL() { - return isGL2ES2() ; - } - /** * General validation if type is a valid GL data type * for the current profile @@ -639,18 +783,21 @@ public class GLProfile implements Cloneable { private static final boolean isAWTAvailable; private static final boolean isAWTJOGLAvailable; - private static final boolean hasGL3bcImpl; - private static final boolean hasGL3Impl; - private static final boolean hasGL2Impl; - private static final boolean hasGL2ES12Impl; - private static final boolean hasGLES2Impl; - private static final boolean hasGLES1Impl; + private static /*final*/ boolean hasGL234Impl; + private static /*final*/ boolean hasGL4bcImpl; + private static /*final*/ boolean hasGL4Impl; + private static /*final*/ boolean hasGL3bcImpl; + private static /*final*/ boolean hasGL3Impl; + private static /*final*/ boolean hasGL2Impl; + private static /*final*/ boolean hasGL2ES12Impl; + private static /*final*/ boolean hasGLES2Impl; + private static /*final*/ boolean hasGLES1Impl; /** The JVM/process wide default GL profile **/ - private static GLProfile defaultGLProfile; + private static /*final*/ GLProfile defaultGLProfile; /** All GLProfiles */ - private static final HashMap/*<String, GLProfile>*/ mappedProfiles; + private static /*final*/ HashMap/*<String, GLProfile>*/ mappedProfiles; /** * Tries the profiles implementation and native libraries. @@ -662,115 +809,203 @@ public class GLProfile implements Cloneable { AccessControlContext acc = AccessController.getContext(); isAWTAvailable = !Debug.getBooleanProperty("java.awt.headless", true, acc) && - NWReflection.isClassAvailable("java.awt.Component") ; + ReflectionUtil.isClassAvailable("java.awt.Component") ; isAWTJOGLAvailable = isAWTAvailable && - NWReflection.isClassAvailable("javax.media.nativewindow.awt.AWTGraphicsDevice") && // NativeWindow - NWReflection.isClassAvailable("javax.media.opengl.awt.GLCanvas") ; // JOGL + ReflectionUtil.isClassAvailable("javax.media.nativewindow.awt.AWTGraphicsDevice") && // NativeWindow + ReflectionUtil.isClassAvailable("javax.media.opengl.awt.GLCanvas") ; // JOGL boolean hasDesktopGL = false; boolean hasDesktopGLES12 = false; boolean hasNativeOSFactory = false; - + Throwable t; + + // + // First iteration of desktop GL availability detection + // - native libs exist + // - class exists + // + t=null; try { // See DRIHack.java for an explanation of why this is necessary DRIHack.begin(); - NativeLibLoader.loadGLDesktop(); + GLJNILibLoader.loadGLDesktop(); DRIHack.end(); hasDesktopGL = true; - } catch (Throwable t) { + } catch (UnsatisfiedLinkError ule) { + t=ule; + } catch (SecurityException se) { + t=se; + } catch (NullPointerException npe) { + t=npe; + } catch (RuntimeException re) { + t=re; + } + if(null!=t) { if (DEBUG) { System.err.println("GLProfile.static Desktop GL Library not available"); t.printStackTrace(); } } + t=null; try { // See DRIHack.java for an explanation of why this is necessary DRIHack.begin(); - NativeLibLoader.loadGLDesktopES12(); + GLJNILibLoader.loadGLDesktopES12(); DRIHack.end(); hasDesktopGLES12 = true; - } catch (Throwable t) { + } catch (UnsatisfiedLinkError ule) { + t=ule; + } catch (SecurityException se) { + t=se; + } catch (NullPointerException npe) { + t=npe; + } catch (RuntimeException re) { + t=re; + } + if(null!=t) { if (DEBUG) { - System.err.println("GLProfile.static Desktop GL ES12 Library not available"); + System.err.println("GLProfile.static Desktop GLES12 Library not available"); t.printStackTrace(); } } + + hasGL234Impl = hasDesktopGL && ReflectionUtil.isClassAvailable("com.jogamp.opengl.impl.gl4.GL4bcImpl"); + hasGL4bcImpl = hasGL234Impl; + hasGL4Impl = hasGL234Impl; + hasGL3bcImpl = hasGL234Impl; + hasGL3Impl = hasGL234Impl; + hasGL2Impl = hasGL234Impl; + hasGL2ES12Impl = hasDesktopGLES12 && ReflectionUtil.isClassAvailable("com.jogamp.opengl.impl.gl2es12.GL2ES12Impl"); + mappedProfiles = computeProfileMap(); + + // + // Second iteration of desktop GL availability detection + // utilizing the detected GL version in the shared context. + // + // - Instantiate GLDrawableFactory incl its shared dummy drawable/context, + // which will register at GLContext .. + // + if(hasDesktopGL||hasDesktopGLES12) { + // if successfull it has a shared dummy drawable and context created try { - hasNativeOSFactory = null!=GLDrawableFactory.getFactoryImpl(GL2); - } catch (Throwable t) { - if (DEBUG) { - System.err.println("GLProfile.static - Native platform GLDrawable factory not available"); - t.printStackTrace(); - } + hasNativeOSFactory = null != GLDrawableFactory.getFactoryImpl(GL2); + } catch (RuntimeException re) { + System.err.println("GLProfile.static - Native platform GLDrawable factory not available"); + re.printStackTrace(); } } - if(!hasNativeOSFactory) { - hasDesktopGLES12=false; - hasDesktopGL=false; + if(hasNativeOSFactory && !GLContext.mappedVersionsAvailableSet) { + // nobody yet set the available desktop versions, see {@link GLContextImpl#makeCurrent}, + // so we have to add the usual suspect + GLContext.mapVersionAvailable(2, true, 1, 5, GLContext.CTX_PROFILE_COMPAT|GLContext.CTX_OPTION_ANY); } - // FIXME: check for real GL3 availability .. ? - hasGL3bcImpl = hasDesktopGL && NWReflection.isClassAvailable("com.sun.opengl.impl.gl3.GL3bcImpl"); - hasGL3Impl = hasDesktopGL && NWReflection.isClassAvailable("com.sun.opengl.impl.gl3.GL3Impl"); - hasGL2Impl = hasDesktopGL && NWReflection.isClassAvailable("com.sun.opengl.impl.gl2.GL2Impl"); - - hasGL2ES12Impl = hasDesktopGLES12 && NWReflection.isClassAvailable("com.sun.opengl.impl.gl2es12.GL2ES12Impl"); + if(!hasNativeOSFactory) { + hasDesktopGL = false; + hasGL234Impl = false; + hasGL4bcImpl = false; + hasGL4Impl = false; + hasGL3bcImpl = false; + hasGL3Impl = false; + hasGL2ES12Impl = false; + hasGL2Impl = false; + } else { + hasGL4bcImpl = hasGL4bcImpl && GLContext.isGL4bcAvailable(); + hasGL4Impl = hasGL4Impl && GLContext.isGL4Available(); + hasGL3bcImpl = hasGL3bcImpl && GLContext.isGL3bcAvailable(); + hasGL3Impl = hasGL3Impl && GLContext.isGL3Available(); + hasGL2Impl = hasGL2Impl && GLContext.isGL2Available(); + hasGL2ES12Impl = hasGL2ES12Impl && GLContext.isGL2Available(); + } boolean btest = false; - boolean hasEGLDynLookup = NWReflection.isClassAvailable("com.sun.opengl.impl.egl.EGLDynamicLookupHelper"); + boolean hasEGLDynLookup = ReflectionUtil.isClassAvailable("com.jogamp.opengl.impl.egl.EGLDynamicLookupHelper"); boolean hasEGLDrawableFactory = false; + t=null; try { if(hasEGLDynLookup) { hasEGLDrawableFactory = null!=GLDrawableFactory.getFactoryImpl(GLES2); - btest = hasEGLDrawableFactory && - NWReflection.isClassAvailable("com.sun.opengl.impl.es2.GLES2Impl") && - null!=com.sun.opengl.impl.egl.EGLDynamicLookupHelper.getDynamicLookupHelper(2); + try { + btest = hasEGLDrawableFactory && + ReflectionUtil.isClassAvailable("com.jogamp.opengl.impl.es2.GLES2Impl") && + null!=com.jogamp.opengl.impl.egl.EGLDynamicLookupHelper.getDynamicLookupHelper(2); + } catch (GLException gle) { + // n/a .. + } } - } catch (Throwable t) { + } catch (UnsatisfiedLinkError ule) { + t=ule; + } catch (SecurityException se) { + t=se; + } catch (NullPointerException npe) { + t=npe; + } catch (RuntimeException re) { + t=re; + } + if(null!=t) { if (DEBUG) { System.err.println("GLProfile.static - GL ES2 Factory/Library not available"); t.printStackTrace(); } } hasGLES2Impl = btest; + if(hasGLES2Impl) { + GLContext.mapVersionAvailable(2, false, 2, 0, GLContext.CTX_PROFILE_ES|GLContext.CTX_PROFILE_CORE|GLContext.CTX_OPTION_ANY); + } btest = false; - try { - if(hasEGLDynLookup) { + if(hasEGLDynLookup) { + try { btest = hasEGLDrawableFactory && - NWReflection.isClassAvailable("com.sun.opengl.impl.es1.GLES1Impl") && - null!=com.sun.opengl.impl.egl.EGLDynamicLookupHelper.getDynamicLookupHelper(1); - } - } catch (Throwable t) { - if (DEBUG) { - System.err.println("GLProfile.static - GL ES1 Factory/Library not available"); - t.printStackTrace(); + ReflectionUtil.isClassAvailable("com.jogamp.opengl.impl.es1.GLES1Impl") && + null!=com.jogamp.opengl.impl.egl.EGLDynamicLookupHelper.getDynamicLookupHelper(1); + } catch (GLException jre) { + /* just not available .. */ } } hasGLES1Impl = btest; + if(hasGLES1Impl) { + GLContext.mapVersionAvailable(1, false, 1, 0, GLContext.CTX_PROFILE_ES|GLContext.CTX_PROFILE_CORE|GLContext.CTX_OPTION_ANY); + } + + mappedProfiles = computeProfileMap(); + if(null==defaultGLProfile) { + throw new GLException("No profile available: "+list2String(GL_PROFILE_LIST_ALL)+", "+glAvailabilityToString()); + } if (DEBUG) { System.err.println("GLProfile.static isAWTAvailable "+isAWTAvailable); System.err.println("GLProfile.static isAWTJOGLAvailable "+isAWTJOGLAvailable); System.err.println("GLProfile.static hasNativeOSFactory "+hasNativeOSFactory); - System.err.println("GLProfile.static hasDesktopGLES12 "+hasDesktopGLES12); System.err.println("GLProfile.static hasDesktopGL "+hasDesktopGL); - System.err.println("GLProfile.static hasGL3bcImpl "+hasGL3bcImpl); - System.err.println("GLProfile.static hasGL3Impl "+hasGL3Impl); - System.err.println("GLProfile.static hasGL2Impl "+hasGL2Impl); - System.err.println("GLProfile.static hasGL2ES12Impl "+hasGL2ES12Impl); + System.err.println("GLProfile.static hasDesktopGLES12 "+hasDesktopGLES12); System.err.println("GLProfile.static hasEGLDynLookup "+hasEGLDynLookup); System.err.println("GLProfile.static hasEGLDrawableFactory "+hasEGLDrawableFactory); - System.err.println("GLProfile.static hasGLES2Impl "+hasGLES2Impl); - System.err.println("GLProfile.static hasGLES1Impl "+hasGLES1Impl); + System.err.println("GLProfile.static hasGL234Impl "+hasGL234Impl); + System.err.println("GLProfile.static "+glAvailabilityToString()); } + } + private static final String list2String(String[] list) { + StringBuffer msg = new StringBuffer(); + msg.append("["); + for (int i = 0; i < list.length; i++) { + if (i > 0) + msg.append(", "); + msg.append(list[i]); + } + msg.append("]"); + return msg.toString(); + } + + private static HashMap computeProfileMap() { + defaultGLProfile=null; HashMap/*<String, GLProfile>*/ _mappedProfiles = new HashMap(GL_PROFILE_LIST_ALL.length); for(int i=0; i<GL_PROFILE_LIST_ALL.length; i++) { String profile = GL_PROFILE_LIST_ALL[i]; @@ -793,22 +1028,7 @@ public class GLProfile implements Cloneable { } } } - mappedProfiles = _mappedProfiles; // final .. - if(null==defaultGLProfile) { - throw new GLException("No profile available: "+list2String(GL_PROFILE_LIST_ALL)); - } - } - - private static final String list2String(String[] list) { - StringBuffer msg = new StringBuffer(); - msg.append("["); - for (int i = 0; i < list.length; i++) { - if (i > 0) - msg.append(", "); - msg.append(list[i]); - } - msg.append("]"); - return msg.toString(); + return _mappedProfiles; } /** @@ -820,6 +1040,10 @@ public class GLProfile implements Cloneable { return GL2ES12; } else if(hasGL2Impl) { return GL2; + } else if(hasGL3bcImpl) { + return GL3bc; + } else if(hasGL4bcImpl) { + return GL4bc; } else if(hasGLES1Impl) { return GLES1; } @@ -830,23 +1054,33 @@ public class GLProfile implements Cloneable { return GL2; } else if(hasGL3Impl) { return GL3; - } else if(hasGL3bcImpl) { - return GL3bc; + } else if(hasGL4Impl) { + return GL4; } else if(hasGLES2Impl) { return GLES2; } - } else if(GL3bc.equals(profile) && hasGL3bcImpl) { - return GL3bc; - } else if(GL3.equals(profile)) { - if(hasGL3Impl) { - return GL3; + } else if(GL2GL3.equals(profile)) { + if(hasGL2Impl) { + return GL2; } else if(hasGL3bcImpl) { return GL3bc; + } else if(hasGL4bcImpl) { + return GL4bc; + } else if(hasGL3Impl) { + return GL3; + } else if(hasGL4Impl) { + return GL4; } + } else if(GL4bc.equals(profile) && hasGL4bcImpl) { + return GL4bc; + } else if(GL4.equals(profile) && hasGL4Impl) { + return GL4; + } else if(GL3bc.equals(profile) && hasGL3bcImpl) { + return GL3bc; + } else if(GL3.equals(profile) && hasGL3Impl) { + return GL3; } else if(GL2.equals(profile) && hasGL2Impl) { return GL2; - } else if(GL2GL3.equals(profile) && hasGL2Impl) { - return GL2; } else if(GLES2.equals(profile) && hasGLES2Impl) { return GLES2; } else if(GLES1.equals(profile) && hasGLES1Impl) { diff --git a/src/jogl/classes/javax/media/opengl/GLUniformData.java b/src/jogl/classes/javax/media/opengl/GLUniformData.java index f628ce35a..9b0d5f151 100644 --- a/src/jogl/classes/javax/media/opengl/GLUniformData.java +++ b/src/jogl/classes/javax/media/opengl/GLUniformData.java @@ -10,7 +10,6 @@ public class GLUniformData { * * Number of objects is 1 * - * @param components number of elements of one object, ie 4 for GL_FLOAT_VEC4, */ public GLUniformData(String name, int val) { init(name, 1, new Integer(val)); @@ -21,7 +20,6 @@ public class GLUniformData { * * Number of objects is 1 * - * @param components number of elements of one object, ie 4 for GL_FLOAT_VEC4, */ public GLUniformData(String name, float val) { init(name, 1, new Float(val)); diff --git a/src/jogl/classes/javax/media/opengl/Threading.java b/src/jogl/classes/javax/media/opengl/Threading.java index fecf6c78b..e58792b8f 100755 --- 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.sun.opengl.impl.*; +import com.jogamp.opengl.impl.*; /** 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/GLCanvas.java b/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java index 038d6d280..53e79b8d9 100644 --- a/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java +++ b/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java @@ -43,7 +43,7 @@ import javax.media.opengl.*; import javax.media.nativewindow.*; import javax.media.nativewindow.awt.*; -import com.sun.opengl.impl.*; +import com.jogamp.opengl.impl.*; import java.awt.Canvas; import java.awt.Color; diff --git a/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java b/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java index e4758211e..e8de00629 100644 --- a/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java +++ b/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java @@ -41,20 +41,17 @@ package javax.media.opengl.awt; import javax.media.opengl.*; import javax.media.nativewindow.*; -import javax.media.nativewindow.awt.*; import java.awt.*; import java.awt.geom.*; import java.awt.image.*; import java.beans.*; -import javax.swing.*; import java.nio.*; import java.security.*; -import javax.swing.JComponent; import javax.swing.JPanel; -import com.sun.opengl.util.FBObject; -import com.sun.opengl.impl.*; -import com.sun.opengl.impl.awt.*; +import com.jogamp.opengl.util.FBObject; +import com.jogamp.opengl.impl.*; +import com.jogamp.opengl.impl.awt.*; // FIXME: Subclasses need to call resetGLFunctionAvailability() on their // context whenever the displayChanged() function is called on their @@ -497,7 +494,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable { backend = new J2DOGLBackend(); } else { if (!hardwareAccelerationDisabled && - factory.canCreateGLPbuffer()) { + factory.canCreateGLPbuffer(null)) { backend = new PbufferBackend(); } else { if (softwareRenderingDisabled) { @@ -1429,7 +1426,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable { System.err.println("-- Created External Context: "+j2dContext); } if (DEBUG) { - j2dContext.setGL(new DebugGL2(j2dContext.getGL().getGL2())); +// j2dContext.setGL(new DebugGL2(j2dContext.getGL().getGL2())); } // Check to see whether we can support the requested @@ -1512,7 +1509,8 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable { } } if (joglContext == null) { - if (factory.canCreateExternalGLDrawable()) { + AbstractGraphicsDevice device = j2dContext.getGLDrawable().getNativeWindow().getGraphicsConfiguration().getNativeGraphicsConfiguration().getScreen().getDevice(); + if (factory.canCreateExternalGLDrawable(device)) { joglDrawable = factory.createExternalGLDrawable(); // FIXME: Need to share with j2d context, due to FBO resource .. // - ORIG: joglContext = joglDrawable.createContext(shareWith); @@ -1521,7 +1519,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable { System.err.println("-- Created External Drawable: "+joglDrawable); System.err.println("-- Created Context: "+joglContext); } - } else if (factory.canCreateContextOnJava2DSurface()) { + } else if (factory.canCreateContextOnJava2DSurface(device)) { // Mac OS X code path // FIXME: Need to share with j2d context, due to FBO resource .. // - ORIG: joglContext = factory.createContextOnJava2DSurface(g, shareWith); diff --git a/src/jogl/classes/javax/media/opengl/fixedfunc/GLMatrixFunc.java b/src/jogl/classes/javax/media/opengl/fixedfunc/GLMatrixFunc.java index 61757abde..b899f3c0a 100644 --- a/src/jogl/classes/javax/media/opengl/fixedfunc/GLMatrixFunc.java +++ b/src/jogl/classes/javax/media/opengl/fixedfunc/GLMatrixFunc.java @@ -6,8 +6,6 @@ package javax.media.opengl.fixedfunc; import java.nio.*; -import javax.media.opengl.*; - public interface GLMatrixFunc { public static final int GL_MATRIX_MODE = 0x0BA0; @@ -56,7 +54,7 @@ public interface GLMatrixFunc { /** * glMultMatrixf - * @param params the FloatBuffer's position remains unchanged, + * @param m the FloatBuffer's position remains unchanged, * which is the same behavior than the native JOGL GL impl */ public void glMultMatrixf(java.nio.FloatBuffer m) ; diff --git a/src/jogl/classes/javax/media/opengl/glu/GLUquadric.java b/src/jogl/classes/javax/media/opengl/glu/GLUquadric.java index d5a7a11f3..49451a34b 100755 --- a/src/jogl/classes/javax/media/opengl/glu/GLUquadric.java +++ b/src/jogl/classes/javax/media/opengl/glu/GLUquadric.java @@ -1,7 +1,7 @@ package javax.media.opengl.glu; import javax.media.opengl.GL; -import com.sun.opengl.util.ImmModeSink; +import com.jogamp.opengl.util.ImmModeSink; /** * Wrapper for a GLU quadric object. diff --git a/src/jogl/classes/javax/media/opengl/glu/GLUtessellator.java b/src/jogl/classes/javax/media/opengl/glu/GLUtessellator.java index cb7bd9d76..f98bbe158 100755 --- a/src/jogl/classes/javax/media/opengl/glu/GLUtessellator.java +++ b/src/jogl/classes/javax/media/opengl/glu/GLUtessellator.java @@ -6,7 +6,7 @@ /* ** 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 1.1 (the "License"), the contents of this +** 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 diff --git a/src/jogl/classes/javax/media/opengl/glu/GLUtessellatorCallback.java b/src/jogl/classes/javax/media/opengl/glu/GLUtessellatorCallback.java index 4b5ec63b7..72ad68ceb 100755 --- a/src/jogl/classes/javax/media/opengl/glu/GLUtessellatorCallback.java +++ b/src/jogl/classes/javax/media/opengl/glu/GLUtessellatorCallback.java @@ -6,7 +6,7 @@ /* ** 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 1.1 (the "License"), the contents of this +** 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 @@ -352,5 +352,5 @@ public interface GLUtessellatorCallback { */ public void errorData(int errnum, Object polygonData); - //void mesh(com.sun.opengl.impl.tessellator.GLUmesh mesh); + //void mesh(com.jogamp.opengl.impl.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 bf6f2d29a..f380f4698 100755 --- a/src/jogl/classes/javax/media/opengl/glu/GLUtessellatorCallbackAdapter.java +++ b/src/jogl/classes/javax/media/opengl/glu/GLUtessellatorCallbackAdapter.java @@ -6,7 +6,7 @@ /* ** 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 1.1 (the "License"), the contents of this +** 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 @@ -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.sun.opengl.impl.tessellator.GLUmesh mesh) {} +// public void mesh(com.jogamp.opengl.impl.tessellator.GLUmesh mesh) {} public void error(int errnum) {} public void combine(double[] coords, Object[] data, float[] weight, Object[] outData) {} diff --git a/src/jogl/native/audio/Mixer.cpp b/src/jogl/native/audio/Mixer.cpp index 8843c00ec..9fa5b61bc 100755 --- a/src/jogl/native/audio/Mixer.cpp +++ b/src/jogl/native/audio/Mixer.cpp @@ -2,7 +2,7 @@ #include <stdlib.h> #include <mmsystem.h> #include <mmreg.h> -#include "com_sun_javafx_audio_windows_waveout_Mixer.h" +#include "com_jogamp_audio_windows_waveout_Mixer.h" static HANDLE event = NULL; static HWAVEOUT output = NULL; @@ -57,7 +57,7 @@ void CALLBACK playbackCallback(HWAVEOUT output, } } -JNIEXPORT jboolean JNICALL Java_com_sun_javafx_audio_windows_waveout_Mixer_initializeWaveOut +JNIEXPORT jboolean JNICALL Java_com_jogamp_audio_windows_waveout_Mixer_initializeWaveOut (JNIEnv *env, jclass unused, jlong eventObject) { event = (HANDLE) eventObject; @@ -98,7 +98,7 @@ JNIEXPORT jboolean JNICALL Java_com_sun_javafx_audio_windows_waveout_Mixer_initi return JNI_TRUE; } -JNIEXPORT void JNICALL Java_com_sun_javafx_audio_windows_waveout_Mixer_shutdownWaveOut +JNIEXPORT void JNICALL Java_com_jogamp_audio_windows_waveout_Mixer_shutdownWaveOut (JNIEnv *env, jclass unused) { // writeString("Pausing\n"); @@ -109,7 +109,7 @@ JNIEXPORT void JNICALL Java_com_sun_javafx_audio_windows_waveout_Mixer_shutdownW waveOutClose(output); } -JNIEXPORT jlong JNICALL Java_com_sun_javafx_audio_windows_waveout_Mixer_getNextMixerBuffer +JNIEXPORT jlong JNICALL Java_com_jogamp_audio_windows_waveout_Mixer_getNextMixerBuffer (JNIEnv *env, jclass unused) { WAVEHDR* hdr = NULL; @@ -123,28 +123,28 @@ JNIEXPORT jlong JNICALL Java_com_sun_javafx_audio_windows_waveout_Mixer_getNextM return (jlong) hdr; } -JNIEXPORT jobject JNICALL Java_com_sun_javafx_audio_windows_waveout_Mixer_getMixerBufferData +JNIEXPORT jobject JNICALL Java_com_jogamp_audio_windows_waveout_Mixer_getMixerBufferData (JNIEnv *env, jclass unused, jlong mixerBuffer) { WAVEHDR* hdr = (WAVEHDR*) mixerBuffer; return env->NewDirectByteBuffer(hdr->lpData, hdr->dwBufferLength); } -JNIEXPORT jlong JNICALL Java_com_sun_javafx_audio_windows_waveout_Mixer_getMixerBufferDataAddress +JNIEXPORT jlong JNICALL Java_com_jogamp_audio_windows_waveout_Mixer_getMixerBufferDataAddress (JNIEnv *env, jclass unused, jlong mixerBuffer) { WAVEHDR* hdr = (WAVEHDR*) mixerBuffer; return (jlong) hdr->lpData; } -JNIEXPORT jint JNICALL Java_com_sun_javafx_audio_windows_waveout_Mixer_getMixerBufferDataCapacity +JNIEXPORT jint JNICALL Java_com_jogamp_audio_windows_waveout_Mixer_getMixerBufferDataCapacity (JNIEnv *env, jclass unused, jlong mixerBuffer) { WAVEHDR* hdr = (WAVEHDR*) mixerBuffer; return (jint) hdr->dwBufferLength; } -JNIEXPORT jboolean JNICALL Java_com_sun_javafx_audio_windows_waveout_Mixer_prepareMixerBuffer +JNIEXPORT jboolean JNICALL Java_com_jogamp_audio_windows_waveout_Mixer_prepareMixerBuffer (JNIEnv *env, jclass unused, jlong mixerBuffer) { MMRESULT res = waveOutPrepareHeader(output, @@ -156,7 +156,7 @@ JNIEXPORT jboolean JNICALL Java_com_sun_javafx_audio_windows_waveout_Mixer_prepa return JNI_FALSE; } -JNIEXPORT jboolean JNICALL Java_com_sun_javafx_audio_windows_waveout_Mixer_writeMixerBuffer +JNIEXPORT jboolean JNICALL Java_com_jogamp_audio_windows_waveout_Mixer_writeMixerBuffer (JNIEnv *env, jclass unused, jlong mixerBuffer) { MMRESULT res = waveOutWrite(output, @@ -170,13 +170,13 @@ JNIEXPORT jboolean JNICALL Java_com_sun_javafx_audio_windows_waveout_Mixer_write return JNI_FALSE; } -JNIEXPORT jlong JNICALL Java_com_sun_javafx_audio_windows_waveout_Mixer_CreateEvent +JNIEXPORT jlong JNICALL Java_com_jogamp_audio_windows_waveout_Mixer_CreateEvent (JNIEnv *env, jclass unused) { return (jlong) CreateEvent(NULL, FALSE, TRUE, NULL); } -JNIEXPORT jboolean JNICALL Java_com_sun_javafx_audio_windows_waveout_Mixer_WaitForSingleObject +JNIEXPORT jboolean JNICALL Java_com_jogamp_audio_windows_waveout_Mixer_WaitForSingleObject (JNIEnv *env, jclass unused, jlong eventObject) { DWORD res = WaitForSingleObject((HANDLE) eventObject, INFINITE); @@ -186,13 +186,13 @@ JNIEXPORT jboolean JNICALL Java_com_sun_javafx_audio_windows_waveout_Mixer_WaitF return JNI_FALSE; } -JNIEXPORT void JNICALL Java_com_sun_javafx_audio_windows_waveout_Mixer_SetEvent +JNIEXPORT void JNICALL Java_com_jogamp_audio_windows_waveout_Mixer_SetEvent (JNIEnv *env, jclass unused, jlong eventObject) { SetEvent((HANDLE) eventObject); } -JNIEXPORT void JNICALL Java_com_sun_javafx_audio_windows_waveout_Mixer_CloseHandle +JNIEXPORT void JNICALL Java_com_jogamp_audio_windows_waveout_Mixer_CloseHandle (JNIEnv *env, jclass unused, jlong eventObject) { CloseHandle((HANDLE) eventObject); diff --git a/src/jogl/native/openmax/com_sun_openmax_OMXInstance.c b/src/jogl/native/openmax/com_sun_openmax_OMXInstance.c index c763b0dd6..5317c2abc 100644 --- a/src/jogl/native/openmax/com_sun_openmax_OMXInstance.c +++ b/src/jogl/native/openmax/com_sun_openmax_OMXInstance.c @@ -1,5 +1,5 @@ /* - * javafx_media_video_Movie.c + * media_video_Movie.c * JFXFramework * * Created by sun on 17/02/08. @@ -13,7 +13,7 @@ // http://developer.apple.com/qa/qa2001/qa1149.html // http://developer.apple.com/qa/qa2001/qa1262.html -#include "com_sun_openmax_OMXInstance.h" +#include "com_jogamp_openmax_OMXInstance.h" #include "omx_tool.h" #include <stdarg.h> @@ -21,8 +21,8 @@ static const char * const ClazzNameRuntimeException = "java/lang/RuntimeException"; static jclass runtimeExceptionClz=NULL; #ifdef _WIN32_WCE - #define STDOUT_FILE "\\Storage Card\\javafx_demos\\stdout.txt" - #define STDERR_FILE "\\Storage Card\\javafx_demos\\stderr.txt" + #define STDOUT_FILE "\\Storage Card\\demos\\stdout.txt" + #define STDERR_FILE "\\Storage Card\\demos\\stderr.txt" #endif static void _initStatics(JNIEnv *env) @@ -105,7 +105,7 @@ void OMXInstance_UpdateJavaAttributes(OMXToolBasicAV_t *pOMXAV, KDboolean issueJ } } -JNIEXPORT jlong JNICALL Java_com_sun_openmax_OMXInstance__1createInstance +JNIEXPORT jlong JNICALL Java_com_jogamp_openmax_OMXInstance__1createInstance (JNIEnv *env, jobject instance) { OMXToolBasicAV_t * pOMXAV; @@ -132,7 +132,7 @@ JNIEXPORT jlong JNICALL Java_com_sun_openmax_OMXInstance__1createInstance return (jlong) (intptr_t) (void *)pOMXAV; } -JNIEXPORT void JNICALL Java_com_sun_openmax_OMXInstance__1setStream +JNIEXPORT void JNICALL Java_com_jogamp_openmax_OMXInstance__1setStream (JNIEnv *env, jobject instance, jlong ptr, jint vBufferNum, jstring jpath) { jboolean iscopy; @@ -150,7 +150,7 @@ JNIEXPORT void JNICALL Java_com_sun_openmax_OMXInstance__1setStream fprintf(stdout, "setStream 3 ..\n"); fflush(stdout); // JAU } -JNIEXPORT void JNICALL Java_com_sun_openmax_OMXInstance__1setStreamEGLImageTexture2D +JNIEXPORT void JNICALL Java_com_jogamp_openmax_OMXInstance__1setStreamEGLImageTexture2D (JNIEnv *env, jobject instance, jlong ptr, jint i, jint tex, jlong image, jlong sync) { OMXToolBasicAV_t *pOMXAV = (OMXToolBasicAV_t *)((void *)((intptr_t)ptr)); @@ -161,7 +161,7 @@ JNIEXPORT void JNICALL Java_com_sun_openmax_OMXInstance__1setStreamEGLImageTextu } } -JNIEXPORT void JNICALL Java_com_sun_openmax_OMXInstance__1activateStream +JNIEXPORT void JNICALL Java_com_jogamp_openmax_OMXInstance__1activateStream (JNIEnv *env, jobject instance, jlong ptr) { OMXToolBasicAV_t *pOMXAV = (OMXToolBasicAV_t *)((void *)((intptr_t)ptr)); @@ -171,28 +171,28 @@ JNIEXPORT void JNICALL Java_com_sun_openmax_OMXInstance__1activateStream } } -JNIEXPORT void JNICALL Java_com_sun_openmax_OMXInstance__1attachVideoRenderer +JNIEXPORT void JNICALL Java_com_jogamp_openmax_OMXInstance__1attachVideoRenderer (JNIEnv *env, jobject instance, jlong ptr) { OMXToolBasicAV_t *pOMXAV = (OMXToolBasicAV_t *)((void *)((intptr_t)ptr)); OMXToolBasicAV_AttachVideoRenderer(pOMXAV); } -JNIEXPORT void JNICALL Java_com_sun_openmax_OMXInstance__1detachVideoRenderer +JNIEXPORT void JNICALL Java_com_jogamp_openmax_OMXInstance__1detachVideoRenderer (JNIEnv *env, jobject instance, jlong ptr) { OMXToolBasicAV_t *pOMXAV = (OMXToolBasicAV_t *)((void *)((intptr_t)ptr)); OMXToolBasicAV_DetachVideoRenderer(pOMXAV); } -JNIEXPORT void JNICALL Java_com_sun_openmax_OMXInstance__1setPlaySpeed +JNIEXPORT void JNICALL Java_com_jogamp_openmax_OMXInstance__1setPlaySpeed (JNIEnv *env, jobject instance, jlong ptr, jfloat scale) { OMXToolBasicAV_t *pOMXAV = (OMXToolBasicAV_t *)((void *)((intptr_t)ptr)); OMXToolBasicAV_SetPlaySpeed(pOMXAV, scale); } -JNIEXPORT jfloat JNICALL Java_com_sun_openmax_OMXInstance__1play +JNIEXPORT jfloat JNICALL Java_com_jogamp_openmax_OMXInstance__1play (JNIEnv *env, jobject instance, jlong ptr) { OMXToolBasicAV_t *pOMXAV = (OMXToolBasicAV_t *)((void *)((intptr_t)ptr)); @@ -200,7 +200,7 @@ JNIEXPORT jfloat JNICALL Java_com_sun_openmax_OMXInstance__1play return OMXToolBasicAV_GetCurrentPosition(pOMXAV); } -JNIEXPORT jfloat JNICALL Java_com_sun_openmax_OMXInstance__1pause +JNIEXPORT jfloat JNICALL Java_com_jogamp_openmax_OMXInstance__1pause (JNIEnv *env, jobject instance, jlong ptr) { OMXToolBasicAV_t *pOMXAV = (OMXToolBasicAV_t *)((void *)((intptr_t)ptr)); @@ -208,7 +208,7 @@ JNIEXPORT jfloat JNICALL Java_com_sun_openmax_OMXInstance__1pause return OMXToolBasicAV_GetCurrentPosition(pOMXAV); } -JNIEXPORT jfloat JNICALL Java_com_sun_openmax_OMXInstance__1stop +JNIEXPORT jfloat JNICALL Java_com_jogamp_openmax_OMXInstance__1stop (JNIEnv *env, jobject instance, jlong ptr) { OMXToolBasicAV_t *pOMXAV = (OMXToolBasicAV_t *)((void *)((intptr_t)ptr)); @@ -216,7 +216,7 @@ JNIEXPORT jfloat JNICALL Java_com_sun_openmax_OMXInstance__1stop return OMXToolBasicAV_GetCurrentPosition(pOMXAV); } -JNIEXPORT jfloat JNICALL Java_com_sun_openmax_OMXInstance__1seek +JNIEXPORT jfloat JNICALL Java_com_jogamp_openmax_OMXInstance__1seek (JNIEnv *env, jobject instance, jlong ptr, jfloat pos) { OMXToolBasicAV_t *pOMXAV = (OMXToolBasicAV_t *)((void *)((intptr_t)ptr)); @@ -224,7 +224,7 @@ JNIEXPORT jfloat JNICALL Java_com_sun_openmax_OMXInstance__1seek return OMXToolBasicAV_GetCurrentPosition(pOMXAV); } -JNIEXPORT jint JNICALL Java_com_sun_openmax_OMXInstance__1getNextTextureID +JNIEXPORT jint JNICALL Java_com_jogamp_openmax_OMXInstance__1getNextTextureID (JNIEnv *env, jobject instance, jlong ptr) { jint textureID = 0xffffffff; @@ -235,7 +235,7 @@ JNIEXPORT jint JNICALL Java_com_sun_openmax_OMXInstance__1getNextTextureID return textureID; } -JNIEXPORT jfloat JNICALL Java_com_sun_openmax_OMXInstance__1getCurrentPosition +JNIEXPORT jfloat JNICALL Java_com_jogamp_openmax_OMXInstance__1getCurrentPosition (JNIEnv *env, jobject instance, jlong ptr) { OMXToolBasicAV_t *pOMXAV = (OMXToolBasicAV_t *)((void *)((intptr_t)ptr)); @@ -243,7 +243,7 @@ JNIEXPORT jfloat JNICALL Java_com_sun_openmax_OMXInstance__1getCurrentPosition } -JNIEXPORT void JNICALL Java_com_sun_openmax_OMXInstance__1destroyInstance +JNIEXPORT void JNICALL Java_com_jogamp_openmax_OMXInstance__1destroyInstance (JNIEnv *env, jobject instance, jlong ptr) { OMXToolBasicAV_t *pOMXAV = (OMXToolBasicAV_t *)((void *)((intptr_t)ptr)); diff --git a/src/junit/com/jogamp/test/junit/jogl/acore/TestGLProfile01CORE.java b/src/junit/com/jogamp/test/junit/jogl/acore/TestGLProfile01CORE.java new file mode 100755 index 000000000..a1ff0d860 --- /dev/null +++ b/src/junit/com/jogamp/test/junit/jogl/acore/TestGLProfile01CORE.java @@ -0,0 +1,95 @@ +/* + * Copyright (c) 2010 Sven Gothel. All Rights Reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * - Redistribution of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistribution in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * Neither the name Sven Gothel or the names of + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * This software is provided "AS IS," without a warranty of any kind. ALL + * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, + * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN + * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR + * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR + * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR + * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR + * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE + * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, + * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF + * SVEN GOTHEL HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + */ + +package com.jogamp.test.junit.jogl.acore; + + +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 TestGLProfile01CORE { + static GLProfile glp; + static GLDrawableFactory factory; + + @BeforeClass + public static void initClass() { + glp = GLProfile.getDefault(); + Assert.assertNotNull(glp); + factory = GLDrawableFactory.getFactory(glp); + Assert.assertNotNull(factory); + } + + @AfterClass + public static void releaseClass() { + factory.shutdown(); + factory=null; + } + + @Test + public void test01GLProfileDefault() { + System.out.println("GLProfile <static> "+GLProfile.glAvailabilityToString()); + } + + @Test + public void test02GLProfileMaxFixedFunc() { + System.out.println("GLProfile <static> getMaxFixedFunc(): "+GLProfile.getMaxFixedFunc()); + } + + @Test + public void test02GLProfileMaxProgrammable() { + System.out.println("GLProfile <static> getMaxProgrammable(): "+GLProfile.getMaxProgrammable()); + } + + public static void main(String args[]) throws IOException { + String tstname = TestGLProfile01CORE.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/awt/TestAWT01GLn.java b/src/junit/com/jogamp/test/junit/jogl/awt/TestAWT01GLn.java new file mode 100755 index 000000000..ac34b46b5 --- /dev/null +++ b/src/junit/com/jogamp/test/junit/jogl/awt/TestAWT01GLn.java @@ -0,0 +1,106 @@ +/* + * Copyright (c) 2010 Sven Gothel. All Rights Reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * - Redistribution of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistribution in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * Neither the name Sven Gothel or the names of + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * This software is provided "AS IS," without a warranty of any kind. ALL + * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, + * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN + * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR + * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR + * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR + * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR + * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE + * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, + * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF + * SVEN GOTHEL HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + */ + +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.jogl.demos.gl2.gears.Gears; +import java.awt.Frame; + +import org.junit.Assert; +import org.junit.Before; +import org.junit.After; +import org.junit.Test; + +public class TestAWT01GLn { + Frame frame=null; + GLCanvas glCanvas=null; + + @Before + public void init() { + frame = new Frame("Texture Test"); + Assert.assertNotNull(frame); + } + + @After + public void release() { + Assert.assertNotNull(frame); + Assert.assertNotNull(glCanvas); + frame.setVisible(false); + frame.remove(glCanvas); + frame.dispose(); + 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()); + + Animator animator = new Animator(glCanvas); + frame.setVisible(true); + animator.start(); + + Thread.sleep(500); // 500 ms + + animator.stop(); + } + + @Test + public void test01GLDefault() throws InterruptedException { + GLCapabilities caps = new GLCapabilities(GLProfile.getDefault()); + runTestGL(caps); + } + + /** Both fail on ATI .. if GLn n>2 + public void test02GL3bc() throws InterruptedException { + GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GL3bc)); + runTestGL(caps); + } + + public void test03GLMaxFixed() throws InterruptedException { + GLCapabilities caps = new GLCapabilities(GLProfile.getMaxFixedFunc()); + runTestGL(caps); + } */ + + public static void main(String args[]) { + org.junit.runner.JUnitCore.main(TestAWT01GLn.class.getName()); + } +} 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 new file mode 100755 index 000000000..9b8982ed4 --- /dev/null +++ b/src/junit/com/jogamp/test/junit/jogl/demos/es1/RedSquare.java @@ -0,0 +1,170 @@ +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) { + 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) { + 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) { + 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"); + } + } + + public void displayChanged(GLAutoDrawable drawable, boolean modeChanged, boolean deviceChanged) { + } + +} 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 new file mode 100644 index 000000000..135efd341 --- /dev/null +++ b/src/junit/com/jogamp/test/junit/jogl/demos/gl2/gears/Gears.java @@ -0,0 +1,306 @@ + +package com.jogamp.test.junit.jogl.demos.gl2.gears; + +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; + +/** + * Gears.java <BR> + * author: Brian Paul (converted to Java by Ron Cemer and Sven Goethel) <P> + * + * This version is equal to Brian Paul's version 1.2 1999/10/21 + */ + +public class Gears implements GLEventListener /* , MouseListener, MouseMotionListener */ { + 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 prevMouseX, prevMouseY; + private boolean mouseRButtonDown = false; + + public void init(GLAutoDrawable drawable) { + // Use debug pipeline + // drawable.setGL(new DebugGL(drawable.getGL())); + + GL2 gl = drawable.getGL().getGL2(); + + System.err.println("INIT GL IS: " + gl.getClass().getName()); + + System.err.println("Chosen GLCapabilities: " + drawable.getChosenGLCapabilities()); + + gl.setSwapInterval(1); + + float pos[] = { 5.0f, 5.0f, 10.0f, 0.0f }; + float red[] = { 0.8f, 0.1f, 0.0f, 1.0f }; + float green[] = { 0.0f, 0.8f, 0.2f, 1.0f }; + float blue[] = { 0.2f, 0.2f, 1.0f, 1.0f }; + + 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); + + /** + if (drawable instanceof AWTGLAutoDrawable) { + AWTGLAutoDrawable awtDrawable = (AWTGLAutoDrawable) drawable; + awtDrawable.addMouseListener(this); + awtDrawable.addMouseMotionListener(this); + } */ + } + + public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) { + GL2 gl = drawable.getGL().getGL2(); + + float h = (float)height / (float)width; + + gl.glMatrixMode(GL2.GL_PROJECTION); + + System.err.println("GL_VENDOR: " + gl.glGetString(GL2.GL_VENDOR)); + System.err.println("GL_RENDERER: " + gl.glGetString(GL2.GL_RENDERER)); + System.err.println("GL_VERSION: " + gl.glGetString(GL2.GL_VERSION)); + 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.out.println("Gears.dispose: "+drawable); + } + + 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(); + + /** + // Special handling for the case where the GLJPanel is translucent + // and wants to be composited with other Java 2D content + if ((drawable instanceof GLJPanel) && + !((GLJPanel) drawable).isOpaque() && + ((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 void displayChanged(GLAutoDrawable drawable, boolean modeChanged, boolean deviceChanged) {} + + 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(); + } + + /*** + // Methods required for the implementation of MouseListener + public void mouseEntered(MouseEvent e) {} + public void mouseExited(MouseEvent e) {} + + 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 mouseClicked(MouseEvent e) {} + + // Methods required for the implementation of MouseMotionListener + public void mouseDragged(MouseEvent e) { + int x = e.getX(); + int y = e.getY(); + Dimension size = e.getComponent().getSize(); + + float thetaY = 360.0f * ( (float)(x-prevMouseX)/(float)size.width); + float thetaX = 360.0f * ( (float)(prevMouseY-y)/(float)size.height); + + prevMouseX = x; + prevMouseY = y; + + view_rotx += thetaX; + view_roty += thetaY; + } + + public void mouseMoved(MouseEvent e) {} + */ +} diff --git a/src/junit/com/jogamp/test/junit/jogl/drawable/TestDrawable01NEWT.java b/src/junit/com/jogamp/test/junit/jogl/drawable/TestDrawable01NEWT.java new file mode 100755 index 000000000..0320c50ae --- /dev/null +++ b/src/junit/com/jogamp/test/junit/jogl/drawable/TestDrawable01NEWT.java @@ -0,0 +1,185 @@ +/* + * Copyright (c) 2010 Sven Gothel. All Rights Reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * - Redistribution of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistribution in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * Neither the name Sven Gothel or the names of + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * This software is provided "AS IS," without a warranty of any kind. ALL + * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, + * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN + * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR + * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR + * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR + * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR + * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE + * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, + * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF + * SVEN GOTHEL HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + */ + +package com.jogamp.test.junit.jogl.drawable; + + +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 { + static GLProfile glp; + static GLDrawableFactory factory; + static int width, height; + GLCapabilities caps; + Window window; + GLDrawable drawable; + GLContext context; + + @BeforeClass + public static void initClass() { + glp = GLProfile.getDefault(); + Assert.assertNotNull(glp); + factory = GLDrawableFactory.getFactory(glp); + Assert.assertNotNull(factory); + width = 640; + height = 480; + } + + @AfterClass + public static void releaseClass() { + factory.shutdown(); + 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, onscreen && undecorated); + Assert.assertNotNull(window); + 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.assertTrue(glCaps.isOnscreen()==onscreen); + Assert.assertTrue(onscreen || !pbuffer || glCaps.isPBuffer()); // pass if onscreen, or !pbuffer req. or have pbuffer + Assert.assertTrue(glCaps.getDoubleBuffered()==!onscreen); + Assert.assertTrue(glCaps.getDepthBits()>4); + + drawable = factory.createGLDrawable(window); + Assert.assertNotNull(drawable); + // System.out.println("Pre: "+drawable); + // + drawable.setRealized(true); + Assert.assertTrue(width==drawable.getWidth()); + Assert.assertTrue(height==drawable.getHeight()); + // Assert.assertTrue(glCaps==drawable.getChosenGLCapabilities()); + Assert.assertTrue(window==drawable.getNativeWindow()); + // 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.destroy(true); // incl screen + display + + 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/nativewindow/classes/com/sun/nativewindow/impl/jvm/JVMUtil.java b/src/junit/com/jogamp/test/junit/jogl/offscreen/ReadBuffer2File.java index 3faab68bb..de7c8d43a 100644..100755 --- a/src/nativewindow/classes/com/sun/nativewindow/impl/jvm/JVMUtil.java +++ b/src/junit/com/jogamp/test/junit/jogl/offscreen/ReadBuffer2File.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright (c) 2010 Sven Gothel. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -12,7 +12,7 @@ * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * - * Neither the name of Sun Microsystems, Inc. or the names of + * Neither the name Sven Gothel or the names of * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * @@ -27,46 +27,47 @@ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF - * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + * SVEN GOTHEL HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ +package com.jogamp.test.junit.jogl.offscreen; -package com.sun.nativewindow.impl.jvm; +import java.io.IOException; +import javax.media.opengl.*; -import java.nio.ByteBuffer; -import com.sun.nativewindow.impl.*; +import com.jogamp.opengl.util.texture.TextureIO; +import java.io.File; -/** - * Currently this tool works around the Hotspot race condition bugs: - <PRE> - 4395095 JNI access to java.nio DirectBuffer constructor/accessor - 6852404 Race condition in JNI Direct Buffer access and creation routines - </PRE> - * - * Make sure to initialize this class as soon as possible, - * before doing any multithreading work. - * - */ -public class JVMUtil { - private static final boolean DEBUG = Debug.debug("JVMUtil"); - - static { - NativeLibLoaderBase.loadNativeWindow("jvm"); +public class ReadBuffer2File extends ReadBufferBase { - ByteBuffer buffer = InternalBufferUtil.newByteBuffer(64); - if( ! initialize(buffer) ) { - throw new RuntimeException("Failed to initialize the JVMUtil "+Thread.currentThread().getName()); - } - if(DEBUG) { - Exception e = new Exception("JVMUtil.initSingleton() .. initialized "+Thread.currentThread().getName()); - e.printStackTrace(); - } + public ReadBuffer2File(GLDrawable externalRead) { + super(externalRead); } - public static void initSingleton() { + @Override + public void dispose(GLAutoDrawable drawable) { + super.dispose(drawable); } + int shotNum = 0; + + void copyTextureData2File() throws IOException { + if (!readBufferUtil.isValid()) { + return; + } - private JVMUtil() {} + File file = File.createTempFile("shot" + shotNum + "-", ".ppm"); + TextureIO.write(readBufferUtil.getTextureData(), file); + System.out.println("Wrote: " + file.getAbsolutePath() + ", ..."); + shotNum++; + readBufferUtil.rewindPixelBuffer(); + } - private static native boolean initialize(java.nio.ByteBuffer buffer); + @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 new file mode 100755 index 000000000..030a7e173 --- /dev/null +++ b/src/junit/com/jogamp/test/junit/jogl/offscreen/ReadBuffer2Screen.java @@ -0,0 +1,192 @@ +/* + * Copyright (c) 2010 Sven Gothel. All Rights Reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * - Redistribution of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistribution in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * Neither the name Sven Gothel or the names of + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * This software is provided "AS IS," without a warranty of any kind. ALL + * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, + * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN + * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR + * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR + * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR + * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR + * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE + * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, + * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF + * SVEN GOTHEL HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + */ + +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 new file mode 100755 index 000000000..4841d33e9 --- /dev/null +++ b/src/junit/com/jogamp/test/junit/jogl/offscreen/ReadBufferBase.java @@ -0,0 +1,95 @@ +/* + * Copyright (c) 2010 Sven Gothel. All Rights Reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * - Redistribution of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistribution in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * Neither the name Sven Gothel or the names of + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * This software is provided "AS IS," without a warranty of any kind. ALL + * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, + * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN + * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR + * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR + * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR + * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR + * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE + * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, + * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF + * SVEN GOTHEL HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + */ + +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 new file mode 100755 index 000000000..ff3b9b58a --- /dev/null +++ b/src/junit/com/jogamp/test/junit/jogl/offscreen/ReadBufferUtil.java @@ -0,0 +1,111 @@ +/* + * Copyright (c) 2010 Sven Gothel. All Rights Reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * - Redistribution of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistribution in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * Neither the name Sven Gothel or the names of + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * This software is provided "AS IS," without a warranty of any kind. ALL + * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, + * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN + * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR + * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR + * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR + * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR + * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE + * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, + * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF + * SVEN GOTHEL HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + */ + +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 new file mode 100755 index 000000000..2799d72c4 --- /dev/null +++ b/src/junit/com/jogamp/test/junit/jogl/offscreen/Surface2File.java @@ -0,0 +1,82 @@ +/* + * Copyright (c) 2010 Sven Gothel. All Rights Reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * - Redistribution of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistribution in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * Neither the name Sven Gothel or the names of + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * This software is provided "AS IS," without a warranty of any kind. ALL + * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, + * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN + * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR + * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR + * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR + * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR + * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE + * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, + * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF + * SVEN GOTHEL HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + */ +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, NativeWindow window, 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 new file mode 100755 index 000000000..459b41f16 --- /dev/null +++ b/src/junit/com/jogamp/test/junit/jogl/offscreen/TestOffscreen01NEWT.java @@ -0,0 +1,389 @@ +/* + * Copyright (c) 2010 Sven Gothel. All Rights Reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * - Redistribution of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistribution in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * Neither the name Sven Gothel or the names of + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * This software is provided "AS IS," without a warranty of any kind. ALL + * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, + * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN + * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR + * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR + * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR + * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR + * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE + * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, + * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF + * SVEN GOTHEL HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + */ + +package com.jogamp.test.junit.jogl.offscreen; + +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.AfterClass; +import org.junit.After; +import org.junit.Test; + +import javax.media.opengl.*; +import javax.media.nativewindow.*; + +import com.jogamp.newt.*; +import com.jogamp.newt.opengl.*; + +import com.jogamp.test.junit.jogl.demos.gl2.gears.Gears; +import com.jogamp.test.junit.jogl.demos.es1.RedSquare; +import java.io.IOException; + +public class TestOffscreen01NEWT { + static GLProfile glpDefault; + static GLDrawableFactory factory; + static int width, height; + GLCapabilities capsDefault; + + @BeforeClass + public static void initClass() { + glpDefault = GLProfile.getDefault(); + Assert.assertNotNull(glpDefault); + factory = GLDrawableFactory.getFactory(glpDefault); + Assert.assertNotNull(factory); + width = 640; + height = 480; + } + + @AfterClass + public static void releaseClass() { + factory.shutdown(); + factory=null; + } + + @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, false /* undecorated */); + 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); + + 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() { + GLCapabilities caps2 = WindowUtilNEWT.fixCaps(capsDefault, false, true, false); + do01OffscreenWindowPBuffer(caps2); + } + + @Test + public void test01bOffscreenWindowPBufferStencil() { + GLCapabilities caps2 = WindowUtilNEWT.fixCaps(capsDefault, false, true, false); + caps2.setStencilBits(8); + do01OffscreenWindowPBuffer(caps2); + } + + @Test + public void test01cOffscreenWindowPBufferStencilAlpha() { + GLCapabilities caps2 = WindowUtilNEWT.fixCaps(capsDefault, false, true, false); + caps2.setStencilBits(8); + caps2.setAlphaBits(8); + do01OffscreenWindowPBuffer(caps2); + } + + @Test + public void test01cOffscreenWindowPBuffer555() { + GLCapabilities caps2 = WindowUtilNEWT.fixCaps(capsDefault, false, true, false); + caps2.setRedBits(5); + caps2.setGreenBits(5); + caps2.setBlueBits(5); + do01OffscreenWindowPBuffer(caps2); + } + + @Test + public void test02Offscreen3Windows1DisplayPBuffer() { + 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, false /* undecorated */); + 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); + } + + 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() { + 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); // 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, false /* undecorated */); + 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); + } + + 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() { + 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, false /* undecorated */); + 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(); + } + } + + @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, false /* undecorated */); + 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); + + 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); + + 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, false /* undecorated */); + 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 = 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 new file mode 100755 index 000000000..55ad83d25 --- /dev/null +++ b/src/junit/com/jogamp/test/junit/jogl/offscreen/WindowUtilNEWT.java @@ -0,0 +1,113 @@ +/* + * Copyright (c) 2010 Sven Gothel. All Rights Reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * - Redistribution of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistribution in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * Neither the name Sven Gothel or the names of + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * This software is provided "AS IS," without a warranty of any kind. ALL + * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, + * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN + * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR + * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR + * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR + * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR + * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE + * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, + * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF + * SVEN GOTHEL HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + */ + +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.opengl.*; + +public class WindowUtilNEWT { + + public static GLCapabilities fixCaps(GLCapabilities caps, boolean onscreen, boolean pbuffer, boolean undecorated) { + GLCapabilities caps2 = (GLCapabilities) caps.clone(); + 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 new file mode 100755 index 000000000..4bbbaa271 --- /dev/null +++ b/src/junit/com/jogamp/test/junit/jogl/texture/TestTexture01AWT.java @@ -0,0 +1,109 @@ +/* + * Copyright (c) 2010 Sven Gothel. All Rights Reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * - Redistribution of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistribution in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * Neither the name Sven Gothel or the names of + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * This software is provided "AS IS," without a warranty of any kind. ALL + * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, + * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN + * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR + * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR + * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR + * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR + * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE + * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, + * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF + * SVEN GOTHEL HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + */ + +package com.jogamp.test.junit.jogl.texture; + +import com.jogamp.test.junit.jogl.util.texture.gl2.TextureGL2ListenerDraw1; + +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 org.junit.Before; +import org.junit.Test; + +public class TestTexture01AWT { + Frame frame; + BufferedImage textureImage; + + @Before + public void init() { + // create base image + BufferedImage baseImage = new BufferedImage(256, 256, BufferedImage.TYPE_INT_RGB); + Graphics2D g = baseImage.createGraphics(); + 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_INT_RGB; + textureImage = new BufferedImage(baseImage.getWidth(), + baseImage.getHeight(), + imageType); + g = textureImage.createGraphics(); + g.setComposite(AlphaComposite.Src); + g.drawImage(baseImage, 0, 0, null); + g.dispose(); + + frame = new Frame("Texture Test"); + } + + @Test + public void test1() throws InterruptedException { + GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GL2GL3)); + GLCanvas glCanvas = new GLCanvas(caps); + 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); + frame.dispose(); + frame=null; + } + + public static void main(String args[]) { + org.junit.runner.JUnitCore.main(TestTexture01AWT.class.getName()); + } +} 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 new file mode 100755 index 000000000..eabd4b79d --- /dev/null +++ b/src/junit/com/jogamp/test/junit/jogl/util/texture/gl2/TextureGL2ListenerDraw1.java @@ -0,0 +1,109 @@ +/* + * Copyright (c) 2010 Sven Gothel. All Rights Reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * - Redistribution of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistribution in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * Neither the name Sven Gothel or the names of + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * This software is provided "AS IS," without a warranty of any kind. ALL + * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, + * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN + * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR + * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR + * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR + * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR + * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE + * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, + * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF + * SVEN GOTHEL HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + */ + +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) { + 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 + 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/TestWindows01NEWT.java b/src/junit/com/jogamp/test/junit/newt/TestWindows01NEWT.java new file mode 100755 index 000000000..4969a685f --- /dev/null +++ b/src/junit/com/jogamp/test/junit/newt/TestWindows01NEWT.java @@ -0,0 +1,165 @@ +/* + * Copyright (c) 2010 Sven Gothel. All Rights Reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * - Redistribution of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistribution in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * Neither the name Sven Gothel or the names of + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * This software is provided "AS IS," without a warranty of any kind. ALL + * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, + * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN + * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR + * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR + * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR + * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR + * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE + * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, + * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF + * SVEN GOTHEL HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + */ + +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; + +public class TestWindows01NEWT { + static int width, height; + + @BeforeClass + public static void initClass() { + 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, onscreen && undecorated); + Assert.assertNotNull(window); + window.setSize(width, height); + Assert.assertTrue(false==window.isVisible()); + window.setVisible(true); + Assert.assertTrue(true==window.isVisible()); + Assert.assertTrue(width==window.getWidth()); + Assert.assertTrue(height==window.getHeight()); + // System.out.println("Created: "+window); + + // + // Create native OpenGL resources .. XGL/WGL/CGL .. + // equivalent to GLAutoDrawable methods: setVisible(true) + // + caps = window.getGraphicsConfiguration().getNativeGraphicsConfiguration().getChosenCapabilities(); + Assert.assertNotNull(caps); + Assert.assertTrue(caps.getGreenBits()>5); + Assert.assertTrue(caps.getBlueBits()>5); + Assert.assertTrue(caps.getRedBits()>5); + Assert.assertTrue(caps.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 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(1000); // 1000 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(1000); // 1000 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(1000); // 1000 ms + destroyWindow(null, null, window2); + destroyWindow(display, screen, window1); + } + + public static void main(String args[]) throws IOException { + String tstname = TestWindows01NEWT.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/util/MiscUtils.java b/src/junit/com/jogamp/test/junit/util/MiscUtils.java new file mode 100644 index 000000000..d28d0e7cb --- /dev/null +++ b/src/junit/com/jogamp/test/junit/util/MiscUtils.java @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2010 Sven Gothel. All Rights Reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * - Redistribution of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistribution in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * Neither the name Sven Gothel or the names of + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * This software is provided "AS IS," without a warranty of any kind. ALL + * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, + * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN + * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR + * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR + * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR + * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR + * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE + * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, + * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF + * SVEN GOTHEL HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + */ + +package com.jogamp.test.junit.util; + +import java.lang.reflect.*; + +public class MiscUtils { + @Deprecated + public static int str2int(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/nativewindow/classes/com/sun/nativewindow/impl/Debug.java b/src/nativewindow/classes/com/jogamp/nativewindow/impl/Debug.java index dd967c71a..edb682392 100644 --- a/src/nativewindow/classes/com/sun/nativewindow/impl/Debug.java +++ b/src/nativewindow/classes/com/jogamp/nativewindow/impl/Debug.java @@ -37,7 +37,7 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.nativewindow.impl; +package com.jogamp.nativewindow.impl; import java.security.*; diff --git a/src/nativewindow/classes/com/sun/nativewindow/impl/GraphicsConfigurationFactoryImpl.java b/src/nativewindow/classes/com/jogamp/nativewindow/impl/GraphicsConfigurationFactoryImpl.java index 4e8e281a8..22f2d544f 100644 --- a/src/nativewindow/classes/com/sun/nativewindow/impl/GraphicsConfigurationFactoryImpl.java +++ b/src/nativewindow/classes/com/jogamp/nativewindow/impl/GraphicsConfigurationFactoryImpl.java @@ -30,7 +30,7 @@ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ -package com.sun.nativewindow.impl; +package com.jogamp.nativewindow.impl; import javax.media.nativewindow.*; diff --git a/src/nativewindow/classes/com/sun/nativewindow/impl/InternalBufferUtil.java b/src/nativewindow/classes/com/jogamp/nativewindow/impl/InternalBufferUtil.java index 0425014df..f590e9b8b 100644 --- a/src/nativewindow/classes/com/sun/nativewindow/impl/InternalBufferUtil.java +++ b/src/nativewindow/classes/com/jogamp/nativewindow/impl/InternalBufferUtil.java @@ -31,13 +31,13 @@ * */ -package com.sun.nativewindow.impl; +package com.jogamp.nativewindow.impl; import java.lang.reflect.*; import java.nio.*; /** Internal copy of selected routines from BufferUtil to avoid - outward dependencies on com.sun.opengl.util package. */ + outward dependencies on com.jogamp.opengl.util package. */ public class InternalBufferUtil { public static final int SIZEOF_BYTE = 1; public static final int SIZEOF_SHORT = 2; diff --git a/src/nativewindow/classes/com/sun/nativewindow/impl/LockingNativeWindowFactory.java b/src/nativewindow/classes/com/jogamp/nativewindow/impl/LockingNativeWindowFactory.java index 880fd8c7d..fd2478ab2 100644 --- a/src/nativewindow/classes/com/sun/nativewindow/impl/LockingNativeWindowFactory.java +++ b/src/nativewindow/classes/com/jogamp/nativewindow/impl/LockingNativeWindowFactory.java @@ -30,7 +30,7 @@ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ -package com.sun.nativewindow.impl; +package com.jogamp.nativewindow.impl; import javax.media.nativewindow.*; diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/impl/NWJNILibLoader.java b/src/nativewindow/classes/com/jogamp/nativewindow/impl/NWJNILibLoader.java new file mode 100644 index 000000000..c3c04287a --- /dev/null +++ b/src/nativewindow/classes/com/jogamp/nativewindow/impl/NWJNILibLoader.java @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2010, Sven Gothel + * 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 Sven Gothel 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 Sven Gothel 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. + */ + +package com.jogamp.nativewindow.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 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/sun/nativewindow/impl/NativeWindowFactoryImpl.java b/src/nativewindow/classes/com/jogamp/nativewindow/impl/NativeWindowFactoryImpl.java index c94dab2f6..d2429cdab 100644 --- a/src/nativewindow/classes/com/sun/nativewindow/impl/NativeWindowFactoryImpl.java +++ b/src/nativewindow/classes/com/jogamp/nativewindow/impl/NativeWindowFactoryImpl.java @@ -30,8 +30,9 @@ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ -package com.sun.nativewindow.impl; +package com.jogamp.nativewindow.impl; +import com.jogamp.common.util.*; import java.lang.reflect.*; import java.security.*; @@ -55,7 +56,7 @@ public class NativeWindowFactoryImpl extends NativeWindowFactory { throw new IllegalArgumentException("AbstractGraphicsConfiguration is null with a non NativeWindow object"); } - if (NWReflection.isAWTComponent(winObj)) { + if (ReflectionUtil.instanceOf(winObj, "java.awt.Component")) { return getAWTNativeWindow(winObj, config); } @@ -76,17 +77,17 @@ public class NativeWindowFactoryImpl extends NativeWindowFactory { // make it easier to run this code on mobile devices if (osType.equals(TYPE_WINDOWS)) { - windowClassName = "com.sun.nativewindow.impl.jawt.windows.WindowsJAWTWindow"; + windowClassName = "com.jogamp.nativewindow.impl.jawt.windows.WindowsJAWTWindow"; } else if (osType.equals(TYPE_MACOSX)) { - windowClassName = "com.sun.nativewindow.impl.jawt.macosx.MacOSXJAWTWindow"; + 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.sun.nativewindow.impl.jawt.x11.X11JAWTWindow"; + windowClassName = "com.jogamp.nativewindow.impl.jawt.x11.X11JAWTWindow"; } else { throw new IllegalArgumentException("OS " + getNativeOSName(false) + " not yet supported"); } - nativeWindowConstructor = NWReflection.getConstructor(windowClassName, new Class[] { Object.class, AbstractGraphicsConfiguration.class }); + nativeWindowConstructor = ReflectionUtil.getConstructor(windowClassName, new Class[] { Object.class, AbstractGraphicsConfiguration.class }); } catch (Exception e) { throw (IllegalArgumentException) new IllegalArgumentException().initCause(e); } diff --git a/src/nativewindow/classes/com/sun/nativewindow/impl/NullWindow.java b/src/nativewindow/classes/com/jogamp/nativewindow/impl/NullWindow.java index ca55aa542..4458d7b3d 100644 --- a/src/nativewindow/classes/com/sun/nativewindow/impl/NullWindow.java +++ b/src/nativewindow/classes/com/jogamp/nativewindow/impl/NullWindow.java @@ -34,7 +34,7 @@ * facility. */ -package com.sun.nativewindow.impl; +package com.jogamp.nativewindow.impl; import javax.media.nativewindow.*; diff --git a/src/nativewindow/classes/com/sun/nativewindow/impl/jawt/JAWTNativeLibLoader.java b/src/nativewindow/classes/com/jogamp/nativewindow/impl/jawt/JAWTJNILibLoader.java index bc963277a..4ea404c09 100644 --- a/src/nativewindow/classes/com/sun/nativewindow/impl/jawt/JAWTNativeLibLoader.java +++ b/src/nativewindow/classes/com/jogamp/nativewindow/impl/jawt/JAWTJNILibLoader.java @@ -37,10 +37,10 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.nativewindow.impl.jawt; +package com.jogamp.nativewindow.impl.jawt; import javax.media.nativewindow.NativeWindowFactory; -import com.sun.nativewindow.impl.NativeLibLoaderBase; +import com.jogamp.nativewindow.impl.NWJNILibLoader; import java.awt.Toolkit; import java.lang.reflect.InvocationTargetException; @@ -48,7 +48,7 @@ import java.lang.reflect.Method; import java.security.AccessController; import java.security.PrivilegedAction; -public class JAWTNativeLibLoader extends NativeLibLoaderBase { +public class JAWTJNILibLoader extends NWJNILibLoader { public static void loadAWTImpl() { AccessController.doPrivileged(new PrivilegedAction() { public Object run() { diff --git a/src/nativewindow/classes/com/sun/nativewindow/impl/jawt/JAWTUtil.java b/src/nativewindow/classes/com/jogamp/nativewindow/impl/jawt/JAWTUtil.java index aac01e990..b3c706ed8 100644 --- a/src/nativewindow/classes/com/sun/nativewindow/impl/jawt/JAWTUtil.java +++ b/src/nativewindow/classes/com/jogamp/nativewindow/impl/jawt/JAWTUtil.java @@ -34,9 +34,9 @@ * facility. */ -package com.sun.nativewindow.impl.jawt; +package com.jogamp.nativewindow.impl.jawt; -import com.sun.nativewindow.impl.*; +import com.jogamp.nativewindow.impl.*; import javax.media.nativewindow.*; @@ -54,8 +54,8 @@ public class JAWTUtil { private static final boolean j2dExist; static { - JAWTNativeLibLoader.loadAWTImpl(); - JAWTNativeLibLoader.loadNativeWindow("awt"); + JAWTJNILibLoader.loadAWTImpl(); + JAWTJNILibLoader.loadNativeWindow("awt"); lockedStack = null; headlessMode = GraphicsEnvironment.isHeadless(); @@ -65,7 +65,7 @@ public class JAWTUtil { Method m=null; if(!headlessMode) { try { - jC = Class.forName("com.sun.opengl.impl.awt.Java2D"); + jC = Class.forName("com.jogamp.opengl.impl.awt.Java2D"); m = jC.getMethod("isQueueFlusherThread", null); ok = true; } catch (Exception e) {} diff --git a/src/nativewindow/classes/com/sun/nativewindow/impl/jawt/JAWTWindow.java b/src/nativewindow/classes/com/jogamp/nativewindow/impl/jawt/JAWTWindow.java index b0548bb14..d0529878f 100644 --- a/src/nativewindow/classes/com/sun/nativewindow/impl/jawt/JAWTWindow.java +++ b/src/nativewindow/classes/com/jogamp/nativewindow/impl/jawt/JAWTWindow.java @@ -34,15 +34,15 @@ * facility. */ -package com.sun.nativewindow.impl.jawt; +package com.jogamp.nativewindow.impl.jawt; -import com.sun.nativewindow.impl.*; +import com.jogamp.nativewindow.impl.*; import java.awt.Component; import java.awt.Window; import java.awt.GraphicsEnvironment; import javax.media.nativewindow.*; -import com.sun.nativewindow.impl.*; +import com.jogamp.nativewindow.impl.*; public abstract class JAWTWindow implements NativeWindow { protected static final boolean DEBUG = Debug.debug("JAWT"); diff --git a/src/nativewindow/classes/com/sun/nativewindow/impl/jawt/JAWT_PlatformInfo.java b/src/nativewindow/classes/com/jogamp/nativewindow/impl/jawt/JAWT_PlatformInfo.java index cc6af7ea4..d49e2f8d0 100644 --- a/src/nativewindow/classes/com/sun/nativewindow/impl/jawt/JAWT_PlatformInfo.java +++ b/src/nativewindow/classes/com/jogamp/nativewindow/impl/jawt/JAWT_PlatformInfo.java @@ -37,9 +37,9 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.nativewindow.impl.jawt; +package com.jogamp.nativewindow.impl.jawt; -import com.sun.nativewindow.impl.*; +import com.jogamp.nativewindow.impl.*; /** Marker class for all window system-specific JAWT data structures. */ diff --git a/src/nativewindow/classes/com/sun/nativewindow/impl/jawt/macosx/MacOSXJAWTWindow.java b/src/nativewindow/classes/com/jogamp/nativewindow/impl/jawt/macosx/MacOSXJAWTWindow.java index 4ecc6aa4d..967d43d60 100644 --- a/src/nativewindow/classes/com/sun/nativewindow/impl/jawt/macosx/MacOSXJAWTWindow.java +++ b/src/nativewindow/classes/com/jogamp/nativewindow/impl/jawt/macosx/MacOSXJAWTWindow.java @@ -37,10 +37,10 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.nativewindow.impl.jawt.macosx; +package com.jogamp.nativewindow.impl.jawt.macosx; -import com.sun.nativewindow.impl.jawt.*; -import com.sun.nativewindow.impl.*; +import com.jogamp.nativewindow.impl.*; +import com.jogamp.nativewindow.impl.jawt.*; import java.awt.GraphicsDevice; import java.awt.GraphicsEnvironment; diff --git a/src/nativewindow/classes/com/sun/nativewindow/impl/jawt/windows/WindowsJAWTWindow.java b/src/nativewindow/classes/com/jogamp/nativewindow/impl/jawt/windows/WindowsJAWTWindow.java index 2b8cab9c4..b23ad3f50 100644 --- a/src/nativewindow/classes/com/sun/nativewindow/impl/jawt/windows/WindowsJAWTWindow.java +++ b/src/nativewindow/classes/com/jogamp/nativewindow/impl/jawt/windows/WindowsJAWTWindow.java @@ -37,10 +37,10 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.nativewindow.impl.jawt.windows; +package com.jogamp.nativewindow.impl.jawt.windows; -import com.sun.nativewindow.impl.*; -import com.sun.nativewindow.impl.jawt.*; +import com.jogamp.nativewindow.impl.*; +import com.jogamp.nativewindow.impl.jawt.*; import javax.media.nativewindow.*; diff --git a/src/nativewindow/classes/com/sun/nativewindow/impl/jawt/x11/X11JAWTWindow.java b/src/nativewindow/classes/com/jogamp/nativewindow/impl/jawt/x11/X11JAWTWindow.java index af2b7a71c..f2977e8f0 100644 --- a/src/nativewindow/classes/com/sun/nativewindow/impl/jawt/x11/X11JAWTWindow.java +++ b/src/nativewindow/classes/com/jogamp/nativewindow/impl/jawt/x11/X11JAWTWindow.java @@ -34,14 +34,14 @@ * facility. */ -package com.sun.nativewindow.impl.jawt.x11; +package com.jogamp.nativewindow.impl.jawt.x11; import javax.media.nativewindow.*; import javax.media.nativewindow.x11.*; -import com.sun.nativewindow.impl.x11.*; -import com.sun.nativewindow.impl.jawt.*; -import com.sun.nativewindow.impl.*; +import com.jogamp.nativewindow.impl.x11.*; +import com.jogamp.nativewindow.impl.jawt.*; +import com.jogamp.nativewindow.impl.*; import java.awt.GraphicsDevice; import java.awt.GraphicsEnvironment; diff --git a/src/nativewindow/classes/com/sun/nativewindow/impl/jawt/x11/X11SunJDKReflection.java b/src/nativewindow/classes/com/jogamp/nativewindow/impl/jawt/x11/X11SunJDKReflection.java index ef1f82cee..7cca6f9f3 100644 --- a/src/nativewindow/classes/com/sun/nativewindow/impl/jawt/x11/X11SunJDKReflection.java +++ b/src/nativewindow/classes/com/jogamp/nativewindow/impl/jawt/x11/X11SunJDKReflection.java @@ -37,9 +37,9 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.nativewindow.impl.jawt.x11; +package com.jogamp.nativewindow.impl.jawt.x11; -import com.sun.nativewindow.impl.x11.*; +import com.jogamp.nativewindow.impl.x11.*; import java.awt.GraphicsConfiguration; import java.awt.GraphicsDevice; diff --git a/src/nativewindow/classes/com/sun/nativewindow/impl/x11/X11GraphicsConfigurationFactory.java b/src/nativewindow/classes/com/jogamp/nativewindow/impl/x11/X11GraphicsConfigurationFactory.java index 4709e3ef0..a6f52f3c0 100644 --- a/src/nativewindow/classes/com/sun/nativewindow/impl/x11/X11GraphicsConfigurationFactory.java +++ b/src/nativewindow/classes/com/jogamp/nativewindow/impl/x11/X11GraphicsConfigurationFactory.java @@ -30,12 +30,12 @@ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ -package com.sun.nativewindow.impl.x11; +package com.jogamp.nativewindow.impl.x11; import javax.media.nativewindow.*; import javax.media.nativewindow.x11.*; -import com.sun.nativewindow.impl.x11.XVisualInfo; -import com.sun.nativewindow.impl.x11.X11Lib; +import com.jogamp.nativewindow.impl.x11.XVisualInfo; +import com.jogamp.nativewindow.impl.x11.X11Lib; public class X11GraphicsConfigurationFactory extends GraphicsConfigurationFactory { public AbstractGraphicsConfiguration @@ -58,8 +58,8 @@ public class X11GraphicsConfigurationFactory extends GraphicsConfigurationFactor int num[] = { -1 }; long display = screen.getDevice().getHandle(); + X11Lib.XLockDisplay(display); try { - X11Lib.XLockDisplay(display); XVisualInfo[] xvis = X11Lib.XGetVisualInfoCopied(display, X11Lib.VisualIDMask|X11Lib.VisualScreenMask, xvi_temp, num, 0); if(xvis==null || num[0]<1) { @@ -90,8 +90,8 @@ public class X11GraphicsConfigurationFactory extends GraphicsConfigurationFactor vinfo_template.setC_class(c_class); long display = screen.getDevice().getHandle(); + X11Lib.XLockDisplay(display); try { - X11Lib.XLockDisplay(display); XVisualInfo[] vinfos = X11Lib.XGetVisualInfoCopied(display, X11Lib.VisualScreenMask, vinfo_template, num, 0); XVisualInfo best=null; int rdepth = capabilities.getRedBits() + capabilities.getGreenBits() + capabilities.getBlueBits() + capabilities.getAlphaBits(); diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/impl/x11/X11Util.java b/src/nativewindow/classes/com/jogamp/nativewindow/impl/x11/X11Util.java new file mode 100644 index 000000000..5f5c10885 --- /dev/null +++ b/src/nativewindow/classes/com/jogamp/nativewindow/impl/x11/X11Util.java @@ -0,0 +1,334 @@ +/* + * 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.x11; + +import java.util.HashMap; +import java.util.Map; +import java.util.Collection; +import java.util.ArrayList; +import java.util.Iterator; + +import javax.media.nativewindow.*; + +import com.jogamp.nativewindow.impl.*; + +/** + * Contains a thread safe X11 utility to retrieve thread local display connection,<br> + * as well as the static global display connection.<br> + * + * The TLS variant is thread safe per se, but be aware of the memory leak risk + * where an application heavily utilizing this class on temporary new threads.<br> + */ +public class X11Util { + private static final boolean DEBUG = Debug.debug("X11Util"); + + static { + NWJNILibLoader.loadNativeWindow("x11"); + installIOErrorHandler(); + } + + private X11Util() {} + + private static ThreadLocal currentDisplayMap = new ThreadLocal(); + + // 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 Collection globalNamedDisplayActive = new ArrayList(); + private static Collection globalNamedDisplayPassive = new ArrayList(); + + public static final String nullDeviceName = "nil" ; + + public static class NamedDisplay implements Cloneable { + String name; + long handle; + int refCount; + boolean unCloseable; + + protected NamedDisplay(String name, long handle) { + this.name=name; + this.handle=handle; + this.refCount=1; + this.unCloseable=false; + } + + public final String getName() { return name; } + public final String getNameSafe() { return null == name ? nullDeviceName : name; } + public final long getHandle() { return handle; } + public final int getRefCount() { return refCount; } + public final boolean isUncloseable() { return unCloseable; } + + 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 realXClosePendingDisplays if true, call XCloseDisplay on the remaining ones + */ + public static int shutdown(boolean realXClosePendingDisplays, boolean verbose) { + int num=0; + String msg; + if(DEBUG||verbose) { + msg = "X11Util.Display: Shutdown (active: "+globalNamedDisplayActive.size()+ + ", passive: "+globalNamedDisplayPassive.size() + ")"; + if(DEBUG) { + Exception e = new Exception(msg); + e.printStackTrace(); + } else if(verbose) { + System.err.println(msg); + } + } + + msg = realXClosePendingDisplays ? "Close" : "Keep" ; + + synchronized(globalLock) { + // for all passive displays .. + Collection namedDisplays = globalNamedDisplayPassive; + globalNamedDisplayPassive = new ArrayList(); + for(Iterator iter=namedDisplays.iterator(); iter.hasNext(); ) { + NamedDisplay ndpy = (NamedDisplay)iter.next(); + if(DEBUG||verbose) { + System.err.println(msg+" passive: "+ndpy); + } + if(realXClosePendingDisplays) { + X11Lib.XCloseDisplay(ndpy.getHandle()); + } + num++; + } + + // for all active displays .. + namedDisplays = globalNamedDisplayActive; + globalNamedDisplayActive = new ArrayList(); + for(Iterator iter=namedDisplays.iterator(); iter.hasNext(); ) { + NamedDisplay ndpy = (NamedDisplay)iter.next(); + if(DEBUG||verbose) { + System.err.println(msg+" active: "+ndpy); + } + if(realXClosePendingDisplays) { + X11Lib.XCloseDisplay(ndpy.getHandle()); + } + num++; + } + } + return num; + } + + /** Returns a clone of the thread local display map, you may {@link Object#wait()} on it */ + public static Map getCurrentDisplayMap() { + return (Map) ((HashMap)getCurrentDisplayMapImpl()).clone(); + } + + /** Returns this thread current default display. If it doesn not exist, it is being created, otherwise the reference count is increased */ + public static long createThreadLocalDefaultDisplay() { + return createThreadLocalDisplay(null); + } + + /** Returns this thread named display. If it doesn not exist, it is being created, otherwise the reference count is increased */ + public static long createThreadLocalDisplay(String name) { + NamedDisplay namedDpy = getCurrentDisplay(name); + if(null==namedDpy) { + synchronized(globalLock) { + namedDpy = getNamedDisplay(globalNamedDisplayPassive, name); + if(null != namedDpy) { + if(!globalNamedDisplayPassive.remove(namedDpy)) { throw new RuntimeException("Internal: "+namedDpy); } + globalNamedDisplayActive.add(namedDpy); + addCurrentDisplay( namedDpy ); + } + } + } + if(null==namedDpy) { + long dpy = X11Lib.XOpenDisplay(name); + if(0==dpy) { + throw new NativeWindowException("X11Util.Display: Unable to create a display("+name+") connection in Thread "+Thread.currentThread().getName()); + } + namedDpy = new NamedDisplay(name, dpy); + synchronized(globalLock) { + globalNamedDisplayActive.add(namedDpy); + addCurrentDisplay( namedDpy ); + } + if(DEBUG) { + Exception e = new Exception("X11Util.Display: Created new TLS "+namedDpy+" in thread "+Thread.currentThread().getName()); + e.printStackTrace(); + } + } else { + namedDpy.refCount++; + if(DEBUG) { + Exception e = new Exception("X11Util.Display: Reused TLS "+namedDpy+" in thread "+Thread.currentThread().getName()); + e.printStackTrace(); + } + } + return namedDpy.getHandle(); + } + + /** Decrease the reference count of this thread named display. If it reaches 0, close it. + It returns the handle of the to be closed display. + It throws a RuntimeException in case the named display does not exist, + or the reference count goes below 0. + */ + public static long closeThreadLocalDisplay(String name) { + NamedDisplay namedDpy = getCurrentDisplay(name); + if(null==namedDpy) { + throw new RuntimeException("X11Util.Display: Display("+name+") with given handle is not mapped to TLS in thread "+Thread.currentThread().getName()); + } + if(0==namedDpy.refCount) { + throw new RuntimeException("X11Util.Display: "+namedDpy+" has refCount already 0 in thread "+Thread.currentThread().getName()); + } + long dpy = namedDpy.getHandle(); + namedDpy.refCount--; + if(0==namedDpy.refCount) { + synchronized(globalLock) { + if(!globalNamedDisplayActive.remove(namedDpy)) { throw new RuntimeException("Internal: "+namedDpy); } + if(namedDpy.isUncloseable()) { + globalNamedDisplayPassive.add(namedDpy); + } else { + X11Lib.XCloseDisplay(dpy); + } + removeCurrentDisplay(namedDpy); + } + if(DEBUG) { + String type = namedDpy.isUncloseable() ? "passive" : "real" ; + Exception e = new Exception("X11Util.Display: Closing ( "+type+" ) TLS "+namedDpy+" in thread "+Thread.currentThread().getName()); + e.printStackTrace(); + } + } else if(DEBUG) { + Exception e = new Exception("X11Util.Display: Keep TLS "+namedDpy+" in thread "+Thread.currentThread().getName()); + e.printStackTrace(); + } + return dpy; + } + + public static String getThreadLocalDisplayName(long handle) { + NamedDisplay ndpy = getNamedDisplay(getCurrentDisplayMapImpl().values(), handle); + return null != ndpy ? ndpy.getName() : null; + } + + public static boolean markThreadLocalDisplayUndeletable(long handle) { + NamedDisplay ndpy = getNamedDisplay(getCurrentDisplayMapImpl().values(), handle); + if( null != ndpy ) { + ndpy.unCloseable=true; + return true; + } + return false; + } + + public static String getGlobalDisplayName(long handle, boolean active) { + String name; + synchronized(globalLock) { + NamedDisplay ndpy = getNamedDisplay(active ? globalNamedDisplayActive : globalNamedDisplayPassive, handle); + name = null != ndpy ? ndpy.getName() : null; + } + return name; + } + + public static boolean markGlobalDisplayUndeletable(long handle) { + boolean r=false; + synchronized(globalLock) { + NamedDisplay ndpy = getNamedDisplay(globalNamedDisplayActive, handle); + if( null != ndpy ) { + ndpy.unCloseable=true; + r=true; + } + } + return r; + } + + private static Map getCurrentDisplayMapImpl() { + Map displayMap = (Map) currentDisplayMap.get(); + if(null==displayMap) { + displayMap = new HashMap(); + currentDisplayMap.set( displayMap ); + } + return displayMap; + } + + /** maps the given display to the thread local display map + * and notifies all threads synchronized to this display map. */ + private static NamedDisplay addCurrentDisplay(NamedDisplay newDisplay) { + Map displayMap = getCurrentDisplayMapImpl(); + NamedDisplay oldDisplay = null; + synchronized(displayMap) { + oldDisplay = (NamedDisplay) displayMap.put(newDisplay.getNameSafe(), newDisplay); + displayMap.notifyAll(); + } + return oldDisplay; + } + + /** removes the mapping of the given name from the thread local display map + * and notifies all threads synchronized to this display map. */ + private static NamedDisplay removeCurrentDisplay(NamedDisplay ndpy) { + Map displayMap = getCurrentDisplayMapImpl(); + synchronized(displayMap) { + NamedDisplay ndpyDel = (NamedDisplay) displayMap.remove(ndpy.getNameSafe()); + if(ndpyDel!=ndpy) { + throw new RuntimeException("Wrong mapping req: "+ndpy+", got "+ndpyDel); + } + displayMap.notifyAll(); + } + return ndpy; + } + + /** Returns the thread local display mapped to the given name */ + private static NamedDisplay getCurrentDisplay(String name) { + if(null==name) name=nullDeviceName; + Map displayMap = getCurrentDisplayMapImpl(); + return (NamedDisplay) displayMap.get(name); + } + + private static NamedDisplay getNamedDisplay(Collection namedDisplays, String name) { + if(null==name) name=nullDeviceName; + for(Iterator iter=namedDisplays.iterator(); iter.hasNext(); ) { + NamedDisplay ndpy = (NamedDisplay)iter.next(); + if (ndpy.getNameSafe().equals(name)) { + return ndpy; + } + } + return null; + } + + private static NamedDisplay getNamedDisplay(Collection namedDisplays, long handle) { + for(Iterator iter=namedDisplays.iterator(); iter.hasNext(); ) { + NamedDisplay ndpy = (NamedDisplay)iter.next(); + if (ndpy.getHandle()==handle) { + return ndpy; + } + } + return null; + } + + private static native void installIOErrorHandler(); +} diff --git a/src/nativewindow/classes/com/sun/nativewindow/impl/x11/awt/X11AWTNativeWindowFactory.java b/src/nativewindow/classes/com/jogamp/nativewindow/impl/x11/awt/X11AWTNativeWindowFactory.java index dff733735..616220e14 100644 --- a/src/nativewindow/classes/com/sun/nativewindow/impl/x11/awt/X11AWTNativeWindowFactory.java +++ b/src/nativewindow/classes/com/jogamp/nativewindow/impl/x11/awt/X11AWTNativeWindowFactory.java @@ -30,17 +30,17 @@ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ -package com.sun.nativewindow.impl.x11.awt; +package com.jogamp.nativewindow.impl.x11.awt; import java.awt.GraphicsConfiguration; import java.awt.GraphicsDevice; import java.awt.GraphicsEnvironment; import javax.media.nativewindow.*; -import com.sun.nativewindow.impl.*; -import com.sun.nativewindow.impl.jawt.*; -import com.sun.nativewindow.impl.jawt.x11.*; -import com.sun.nativewindow.impl.x11.*; +import com.jogamp.nativewindow.impl.*; +import com.jogamp.nativewindow.impl.jawt.*; +import com.jogamp.nativewindow.impl.jawt.x11.*; +import com.jogamp.nativewindow.impl.x11.*; public class X11AWTNativeWindowFactory extends NativeWindowFactoryImpl { diff --git a/src/nativewindow/classes/com/sun/nativewindow/impl/NWReflection.java b/src/nativewindow/classes/com/sun/nativewindow/impl/NWReflection.java deleted file mode 100644 index d86fbdc55..000000000 --- a/src/nativewindow/classes/com/sun/nativewindow/impl/NWReflection.java +++ /dev/null @@ -1,181 +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.sun.nativewindow.impl; - -import java.lang.reflect.*; -import javax.media.nativewindow.*; - -public final class NWReflection { - public static final boolean DEBUG = Debug.debug("NWReflection"); - - public static final boolean isClassAvailable(String clazzName) { - try { - Class clazz = Class.forName(clazzName, false, NWReflection.class.getClassLoader()); - return null!=clazz; - } catch (Throwable e) { } - return false; - } - - public static final Class getClass(String clazzName, boolean initialize) { - try { - return Class.forName(clazzName, initialize, NWReflection.class.getClassLoader()); - } catch (Throwable e) { } - return null; - } - - public static final Constructor getConstructor(String clazzName, Class[] cstrArgTypes) { - Class factoryClass = null; - Constructor factory = null; - - try { - factoryClass = getClass(clazzName, true); - if (factoryClass == null) { - throw new NativeWindowException(clazzName + " not available"); - } - return getConstructor(factoryClass, cstrArgTypes); - } catch (Throwable e) { - if (DEBUG) { - e.printStackTrace(); - } - throw new NativeWindowException(e); - } - } - - public static final Constructor getConstructor(Class clazz, Class[] cstrArgTypes) { - Constructor factory = null; - - try { - try { - factory = clazz.getDeclaredConstructor( cstrArgTypes ); - } catch(NoSuchMethodException nsme) { - throw new NativeWindowException("Constructor: '" + clazz + "("+cstrArgTypes+")' not found"); - } - return factory; - } catch (Throwable e) { - if (DEBUG) { - e.printStackTrace(); - } - throw new NativeWindowException(e); - } - } - - public static final Constructor getConstructor(String clazzName) { - return getConstructor(clazzName, new Class[0]); - } - - public static final Object createInstance(Class clazz, Class[] cstrArgTypes, Object[] cstrArgs) { - Constructor factory = null; - - try { - factory = getConstructor(clazz, cstrArgTypes); - return factory.newInstance( cstrArgs ) ; - } catch (Exception e) { - throw new NativeWindowException(e); - } - } - - public static final Object createInstance(Class clazz, Object[] cstrArgs) { - Class[] cstrArgTypes = new Class[cstrArgs.length]; - for(int i=0; i<cstrArgs.length; i++) { - cstrArgTypes[i] = cstrArgs[i].getClass(); - } - return createInstance(clazz, cstrArgTypes, cstrArgs); - } - - public static final Object createInstance(String clazzName, Class[] cstrArgTypes, Object[] cstrArgs) { - Constructor factory = null; - - try { - factory = getConstructor(clazzName, cstrArgTypes); - return factory.newInstance( cstrArgs ) ; - } catch (Exception e) { - throw new NativeWindowException(e); - } - } - - public static final Object createInstance(String clazzName, Object[] cstrArgs) { - Class[] cstrArgTypes = new Class[cstrArgs.length]; - for(int i=0; i<cstrArgs.length; i++) { - cstrArgTypes[i] = cstrArgs[i].getClass(); - } - return createInstance(clazzName, cstrArgTypes, cstrArgs); - } - - public static final Object createInstance(String clazzName) { - return createInstance(clazzName, new Class[0], null); - } - - public static final boolean instanceOf(Object obj, String clazzName) { - return instanceOf(obj.getClass(), clazzName); - } - public static final boolean instanceOf(Class clazz, String clazzName) { - do { - if(clazz.getName().equals(clazzName)) { - return true; - } - clazz = clazz.getSuperclass(); - } while (clazz!=null); - return false; - } - - public static final boolean implementationOf(Object obj, String faceName) { - return implementationOf(obj.getClass(), faceName); - } - public static final boolean implementationOf(Class clazz, String faceName) { - do { - Class[] clazzes = clazz.getInterfaces(); - for(int i=clazzes.length-1; i>=0; i--) { - Class face = clazzes[i]; - if(face.getName().equals(faceName)) { - return true; - } - } - clazz = clazz.getSuperclass(); - } while (clazz!=null); - return false; - } - - public static boolean isAWTComponent(Object target) { - return instanceOf(target, "java.awt.Component"); - } - - public static boolean isAWTComponent(Class clazz) { - return instanceOf(clazz, "java.awt.Component"); - } - -} - diff --git a/src/nativewindow/classes/com/sun/nativewindow/impl/NativeLibLoaderBase.java b/src/nativewindow/classes/com/sun/nativewindow/impl/NativeLibLoaderBase.java deleted file mode 100644 index 570cf1f9d..000000000 --- a/src/nativewindow/classes/com/sun/nativewindow/impl/NativeLibLoaderBase.java +++ /dev/null @@ -1,202 +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.sun.nativewindow.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; - -public class NativeLibLoaderBase { - public static final boolean DEBUG = Debug.debug("NativeLibLoader"); - - public interface LoaderAction { - /** - * Loads the library specified by libname. Optionally preloads the libraries specified by - * preload. The implementation should ignore, if the preload-libraries have already been - * loaded. - * @param libname the library to load - * @param preload the libraries to load before loading the main library if not null - * @param preloadIgnoreError true, if errors during loading the preload-libraries should be ignored - */ - void loadLibrary(String libname, String[] preload, - boolean preloadIgnoreError); - } - - private static class DefaultAction implements LoaderAction { - public void loadLibrary(String libname, String[] preload, - boolean preloadIgnoreError) { - if (null!=preload) { - for (int i=0; i<preload.length; i++) { - if(!isLoaded(preload[i])) { - try { - loadLibraryInternal(preload[i]); - addLoaded(preload[i]); - if(DEBUG) { - System.err.println("NativeLibLoaderBase preloaded "+preload[i]); - } - } - catch (UnsatisfiedLinkError e) { - if(DEBUG) e.printStackTrace(); - if (!preloadIgnoreError && e.getMessage().indexOf("already loaded") < 0) { - throw e; - } - } - } - } - } - loadLibraryInternal(libname); - addLoaded(libname); - if(DEBUG) { - System.err.println("NativeLibLoaderBase loaded "+libname); - } - } - } - - private static final HashSet loaded = new HashSet(); - private static LoaderAction loaderAction = new DefaultAction(); - - public static boolean isLoaded(String libName) { - return loaded.contains(libName); - } - - public static void addLoaded(String libName) { - loaded.add(libName); - if(DEBUG) { - System.err.println("NativeLibLoaderBase Loaded Native Library: "+libName); - } - } - - public static void disableLoading() { - setLoadingAction(null); - } - - public static void enableLoading() { - setLoadingAction(new DefaultAction()); - } - - public static synchronized void setLoadingAction(LoaderAction action) { - loaderAction = action; - } - - protected static synchronized void loadLibrary(String libname, String[] preload, - boolean preloadIgnoreError) { - if (loaderAction != null && !isLoaded(libname)) - { - loaderAction.loadLibrary(libname, preload, preloadIgnoreError); - } - } - - public static void loadNativeWindow(final String ossuffix) { - AccessController.doPrivileged(new PrivilegedAction() { - public Object run() { - loadLibrary("nativewindow_"+ossuffix, null, false); - return null; - } - }); - } - - - private static final Class customLauncherClass; - private static final Method customLoadLibraryMethod; - - static { - Class launcherClass = null; - Method loadLibraryMethod = null; - - if ( Debug.getBooleanProperty("sun.jnlp.applet.launcher", false) ) { - try { - launcherClass = Class.forName("org.jdesktop.applet.util.JNLPAppletLauncher"); - loadLibraryMethod = launcherClass.getDeclaredMethod("loadLibrary", new Class[] { String.class }); - } catch (Throwable t) { - if(DEBUG) { - t.printStackTrace(); - } - launcherClass = null; - loadLibraryMethod = null; - } - } - - if(null==launcherClass) { - String launcherClassName = Debug.getProperty("jnlp.launcher.class", false); - if(null!=launcherClassName) { - try { - launcherClass = Class.forName(launcherClassName); - loadLibraryMethod = launcherClass.getDeclaredMethod("loadLibrary", new Class[] { String.class }); - } catch (Throwable t) { - if(DEBUG) { - t.printStackTrace(); - } - launcherClass = null; - loadLibraryMethod = null; - } - } - } - customLauncherClass = launcherClass; - customLoadLibraryMethod = loadLibraryMethod; - } - - private static void loadLibraryInternal(String libraryName) { - // Note: special-casing JAWT which is built in to the JDK - if (null!=customLoadLibraryMethod && !libraryName.equals("jawt")) { - try { - customLoadLibraryMethod.invoke(null, new Object[] { libraryName }); - } catch (Exception e) { - Throwable t = e; - if (t instanceof InvocationTargetException) { - t = ((InvocationTargetException) t).getTargetException(); - } - if (t instanceof Error) - throw (Error) t; - if (t instanceof RuntimeException) { - throw (RuntimeException) t; - } - // Throw UnsatisfiedLinkError for best compatibility with System.loadLibrary() - throw (UnsatisfiedLinkError) new UnsatisfiedLinkError().initCause(e); - } - } else { - // System.out.println("sun.boot.library.path=" + Debug.getProperty("sun.boot.library.path", false)); - System.loadLibrary(libraryName); - } - } -} diff --git a/src/nativewindow/classes/com/sun/nativewindow/impl/x11/X11Util.java b/src/nativewindow/classes/com/sun/nativewindow/impl/x11/X11Util.java deleted file mode 100644 index 11343f3e1..000000000 --- a/src/nativewindow/classes/com/sun/nativewindow/impl/x11/X11Util.java +++ /dev/null @@ -1,166 +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.sun.nativewindow.impl.x11; - -import java.util.HashMap; -import java.util.Map; - -import javax.media.nativewindow.*; - -import com.sun.nativewindow.impl.*; - -/** - * Contains a thread safe X11 utility to retrieve thread local display connection,<br> - * as well as the static global discplay connection.<br> - * - * The TLS variant is thread safe per se, but be aware of the memory leak risk - * where an application heavily utilizing this class on temporary new threads.<br> - */ -public class X11Util { - private static final boolean DEBUG = Debug.debug("X11Util"); - - static { - NativeLibLoaderBase.loadNativeWindow("x11"); - } - - private X11Util() {} - - private static ThreadLocal currentDisplayMap = new ThreadLocal(); - - public static class NamedDisplay implements Cloneable { - private String name; - private long handle; - - protected NamedDisplay(String name, long handle) { - this.name=name; - this.handle=handle; - } - - public String getName() { return name; } - public long getHandle() { return handle; } - - public Object clone() throws CloneNotSupportedException { - return super.clone(); - } - } - - /** Returns a clone of the thread local display map, you may {@link Object#wait()} on it */ - public static Map getCurrentDisplayMap() { - return (Map) ((HashMap)getCurrentDisplayMapImpl()).clone(); - } - - /** Returns this thread current default display. If it doesn not exist, it is being created */ - public static long getThreadLocalDefaultDisplay() { - return getThreadLocalDisplay(null); - } - - /** Returns this thread named display. If it doesn not exist, it is being created */ - public static long getThreadLocalDisplay(String name) { - NamedDisplay namedDpy = getCurrentDisplay(name); - if(null==namedDpy) { - long dpy = X11Lib.XOpenDisplay(name); - if(0==dpy) { - throw new NativeWindowException("X11Util.Display: Unable to create a display("+name+") connection in Thread "+Thread.currentThread().getName()); - } - namedDpy = new NamedDisplay(name, dpy); - setCurrentDisplay( namedDpy ); - if(DEBUG) { - Exception e = new Exception("X11Util.Display: Created new TLS display("+name+") connection 0x"+Long.toHexString(dpy)+" in thread "+Thread.currentThread().getName()); - e.printStackTrace(); - } - } - return namedDpy.getHandle(); - } - - /** Closes this thread named display. It returns the handle of the closed display or 0, if it does not exist. */ - public static long closeThreadLocalDisplay(String name) { - NamedDisplay namedDpy = removeCurrentDisplay(name); - if(null==namedDpy) { - if(DEBUG) { - Exception e = new Exception("X11Util.Display: Display("+name+") with given handle is not mapped to TLS in thread "+Thread.currentThread().getName()); - e.printStackTrace(); - } - return 0; - } - long dpy = namedDpy.getHandle(); - X11Lib.XCloseDisplay(dpy); - if(DEBUG) { - Exception e = new Exception("X11Util.Display: Closed TLS Display("+name+") with handle 0x"+Long.toHexString(dpy)+" in thread "+Thread.currentThread().getName()); - e.printStackTrace(); - } - return dpy; - } - - private static Map getCurrentDisplayMapImpl() { - Map displayMap = (Map) currentDisplayMap.get(); - if(null==displayMap) { - displayMap = new HashMap(); - currentDisplayMap.set( displayMap ); - } - return displayMap; - } - - /** maps the given display to the thread local display map - * and notifies all threads synchronized to this display map. */ - private static NamedDisplay setCurrentDisplay(NamedDisplay newDisplay) { - Map displayMap = getCurrentDisplayMapImpl(); - NamedDisplay oldDisplay = null; - synchronized(displayMap) { - String name = (null==newDisplay.getName())?"nil":newDisplay.getName(); - oldDisplay = (NamedDisplay) displayMap.put(name, newDisplay); - displayMap.notifyAll(); - } - return oldDisplay; - } - - /** removes the mapping of the given name from the thread local display map - * and notifies all threads synchronized to this display map. */ - private static NamedDisplay removeCurrentDisplay(String name) { - Map displayMap = getCurrentDisplayMapImpl(); - NamedDisplay oldDisplay = null; - synchronized(displayMap) { - if(null==name) name="nil"; - oldDisplay = (NamedDisplay) displayMap.remove(name); - displayMap.notifyAll(); - } - return oldDisplay; - } - - /** Returns the thread local display mapped to the given name */ - private static NamedDisplay getCurrentDisplay(String name) { - if(null==name) name="nil"; - Map displayMap = getCurrentDisplayMapImpl(); - return (NamedDisplay) displayMap.get(name); - } - -} diff --git a/src/nativewindow/classes/javax/media/nativewindow/GraphicsConfigurationFactory.java b/src/nativewindow/classes/javax/media/nativewindow/GraphicsConfigurationFactory.java index 881499bec..c692e51c4 100644 --- a/src/nativewindow/classes/javax/media/nativewindow/GraphicsConfigurationFactory.java +++ b/src/nativewindow/classes/javax/media/nativewindow/GraphicsConfigurationFactory.java @@ -35,7 +35,8 @@ package javax.media.nativewindow; import java.lang.reflect.*; import java.util.*; -import com.sun.nativewindow.impl.*; +import com.jogamp.common.util.*; +import com.jogamp.nativewindow.impl.*; /** * Provides the mechanism by which the graphics configuration for a @@ -77,7 +78,7 @@ public abstract class GraphicsConfigurationFactory { if (NativeWindowFactory.TYPE_X11.equals(NativeWindowFactory.getNativeWindowType(true))) { try { GraphicsConfigurationFactory factory = (GraphicsConfigurationFactory) - NWReflection.createInstance("com.sun.nativewindow.impl.x11.X11GraphicsConfigurationFactory", new Object[] {}); + ReflectionUtil.createInstance("com.jogamp.nativewindow.impl.x11.X11GraphicsConfigurationFactory", new Object[] {}); registerFactory(javax.media.nativewindow.x11.X11GraphicsDevice.class, factory); } catch (Exception e) { throw new RuntimeException(e); diff --git a/src/nativewindow/classes/javax/media/nativewindow/NativeWindowFactory.java b/src/nativewindow/classes/javax/media/nativewindow/NativeWindowFactory.java index cd89e2164..944fdee74 100644 --- a/src/nativewindow/classes/javax/media/nativewindow/NativeWindowFactory.java +++ b/src/nativewindow/classes/javax/media/nativewindow/NativeWindowFactory.java @@ -36,8 +36,9 @@ import java.lang.reflect.*; import java.security.*; import java.util.*; -import com.sun.nativewindow.impl.*; -import com.sun.nativewindow.impl.jvm.JVMUtil; +import com.jogamp.common.util.*; +import com.jogamp.common.jvm.JVMUtil; +import com.jogamp.nativewindow.impl.*; /** Provides a pluggable mechanism for arbitrary window toolkits to adapt their components to the {@link NativeWindow} interface, @@ -123,10 +124,10 @@ public abstract class NativeWindowFactory { // make it easier to run this code on mobile devices Class componentClass = null; - if ( NWReflection.isClassAvailable("java.awt.Component") && - NWReflection.isClassAvailable("javax.media.nativewindow.awt.AWTGraphicsDevice") ) { + if ( ReflectionUtil.isClassAvailable("java.awt.Component") && + ReflectionUtil.isClassAvailable("javax.media.nativewindow.awt.AWTGraphicsDevice") ) { try { - componentClass = NWReflection.getClass("java.awt.Component", false); + componentClass = ReflectionUtil.getClass("java.awt.Component", false); } catch (Exception e) { } } @@ -177,7 +178,7 @@ public abstract class NativeWindowFactory { try { Constructor factoryConstructor = - NWReflection.getConstructor("com.sun.nativewindow.impl.x11.awt.X11AWTNativeWindowFactory", new Class[] {}); + ReflectionUtil.getConstructor("com.jogamp.nativewindow.impl.x11.awt.X11AWTNativeWindowFactory", new Class[] {}); _factory = (NativeWindowFactory) factoryConstructor.newInstance(null); } catch (Exception e) { } } @@ -185,7 +186,7 @@ public abstract class NativeWindowFactory { if (toolkitLockForced && null==_factory) { try { Constructor factoryConstructor = - NWReflection.getConstructor("com.sun.nativewindow.impl.LockingNativeWindowFactory", new Class[] {}); + ReflectionUtil.getConstructor("com.jogamp.nativewindow.impl.LockingNativeWindowFactory", new Class[] {}); _factory = (NativeWindowFactory) factoryConstructor.newInstance(null); } catch (Exception e) { } } diff --git a/src/nativewindow/classes/javax/media/nativewindow/awt/AWTGraphicsConfiguration.java b/src/nativewindow/classes/javax/media/nativewindow/awt/AWTGraphicsConfiguration.java index 7373e7b97..9b48f8f6e 100644 --- a/src/nativewindow/classes/javax/media/nativewindow/awt/AWTGraphicsConfiguration.java +++ b/src/nativewindow/classes/javax/media/nativewindow/awt/AWTGraphicsConfiguration.java @@ -44,7 +44,7 @@ import java.awt.GraphicsConfiguration; import java.awt.Transparency; import java.awt.image.ColorModel; import javax.media.nativewindow.AbstractGraphicsConfiguration; -import com.sun.nativewindow.impl.Debug; +import com.jogamp.nativewindow.impl.Debug; /** A wrapper for an AWT GraphicsConfiguration allowing it to be handled in a toolkit-independent manner. */ diff --git a/src/nativewindow/classes/javax/media/nativewindow/awt/AWTGraphicsDevice.java b/src/nativewindow/classes/javax/media/nativewindow/awt/AWTGraphicsDevice.java index 077cbf8aa..d326b9159 100644 --- a/src/nativewindow/classes/javax/media/nativewindow/awt/AWTGraphicsDevice.java +++ b/src/nativewindow/classes/javax/media/nativewindow/awt/AWTGraphicsDevice.java @@ -43,7 +43,7 @@ import javax.media.nativewindow.*; import java.awt.GraphicsDevice; import java.awt.GraphicsEnvironment; import javax.media.nativewindow.AbstractGraphicsDevice; -import com.sun.nativewindow.impl.*; +import com.jogamp.nativewindow.impl.*; /** A wrapper for an AWT GraphicsDevice allowing it to be handled in a toolkit-independent manner. */ diff --git a/src/nativewindow/classes/javax/media/nativewindow/awt/AWTGraphicsScreen.java b/src/nativewindow/classes/javax/media/nativewindow/awt/AWTGraphicsScreen.java index 2ad8a99af..6cbf2ee71 100644 --- a/src/nativewindow/classes/javax/media/nativewindow/awt/AWTGraphicsScreen.java +++ b/src/nativewindow/classes/javax/media/nativewindow/awt/AWTGraphicsScreen.java @@ -43,7 +43,7 @@ import java.awt.GraphicsDevice; import java.awt.GraphicsEnvironment; import javax.media.nativewindow.*; import javax.media.nativewindow.AbstractGraphicsDevice; -import com.sun.nativewindow.impl.*; +import com.jogamp.nativewindow.impl.*; /** A wrapper for an AWT GraphicsDevice (screen) allowing it to be handled in a toolkit-independent manner. */ diff --git a/src/nativewindow/classes/javax/media/nativewindow/package.html b/src/nativewindow/classes/javax/media/nativewindow/package.html index ce9dbbb7a..fa422b2ab 100644 --- a/src/nativewindow/classes/javax/media/nativewindow/package.html +++ b/src/nativewindow/classes/javax/media/nativewindow/package.html @@ -41,7 +41,7 @@ </ul><br> This protocol <i>does not</i> describe how to <i>create</i> native windows, but how to <i>bind</i> a native window to an implementation of {@link javax.media.nativewindow.NativeWindow NativeWindow}.<br> - However, an implementation of this protocol (e.g. {@link com.sun.javafx.newt}) may support the creation.<br> + 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> diff --git a/src/nativewindow/classes/javax/media/nativewindow/x11/X11GraphicsConfiguration.java b/src/nativewindow/classes/javax/media/nativewindow/x11/X11GraphicsConfiguration.java index 49d5f2d83..5659dcdcc 100644 --- a/src/nativewindow/classes/javax/media/nativewindow/x11/X11GraphicsConfiguration.java +++ b/src/nativewindow/classes/javax/media/nativewindow/x11/X11GraphicsConfiguration.java @@ -33,7 +33,7 @@ package javax.media.nativewindow.x11; import javax.media.nativewindow.*; -import com.sun.nativewindow.impl.x11.XVisualInfo; +import com.jogamp.nativewindow.impl.x11.XVisualInfo; /** Encapsulates a graphics configuration, or OpenGL pixel format, on X11 platforms. Objects of this type are returned from {@link diff --git a/src/nativewindow/classes/javax/media/nativewindow/x11/X11GraphicsScreen.java b/src/nativewindow/classes/javax/media/nativewindow/x11/X11GraphicsScreen.java index 614d26a61..58b40efe0 100644 --- a/src/nativewindow/classes/javax/media/nativewindow/x11/X11GraphicsScreen.java +++ b/src/nativewindow/classes/javax/media/nativewindow/x11/X11GraphicsScreen.java @@ -33,8 +33,8 @@ package javax.media.nativewindow.x11; import javax.media.nativewindow.*; -import com.sun.nativewindow.impl.x11.X11Util; -import com.sun.nativewindow.impl.x11.X11Lib; +import com.jogamp.nativewindow.impl.x11.X11Util; +import com.jogamp.nativewindow.impl.x11.X11Lib; /** Encapsulates a screen index on X11 platforms. Objects of this type are passed to {@link @@ -57,13 +57,16 @@ public class X11GraphicsScreen extends DefaultGraphicsScreen implements Cloneabl /** Creates a new X11GraphicsScreen using a thread local display connection */ public static AbstractGraphicsScreen createDefault() { NativeWindowFactory.getDefaultFactory().getToolkitLock().lock(); - long display = X11Util.getThreadLocalDefaultDisplay(); try { + long display = X11Util.createThreadLocalDefaultDisplay(); X11Lib.XLockDisplay(display); - int scrnIdx = X11Lib.DefaultScreen(display); - return createScreenDevice(display, scrnIdx); + try{ + int scrnIdx = X11Lib.DefaultScreen(display); + return createScreenDevice(display, scrnIdx); + }finally{ + X11Lib.XUnlockDisplay(display); + } } finally { - X11Lib.XUnlockDisplay(display); NativeWindowFactory.getDefaultFactory().getToolkitLock().unlock(); } } @@ -71,13 +74,16 @@ public class X11GraphicsScreen extends DefaultGraphicsScreen implements Cloneabl public long getDefaultVisualID() { // It still could be an AWT hold handle .. NativeWindowFactory.getDefaultFactory().getToolkitLock().lock(); - long display = getDevice().getHandle(); try { + long display = getDevice().getHandle(); X11Lib.XLockDisplay(display); - int scrnIdx = X11Lib.DefaultScreen(display); - return X11Lib.DefaultVisualID(display, scrnIdx); + try{ + int scrnIdx = X11Lib.DefaultScreen(display); + return X11Lib.DefaultVisualID(display, scrnIdx); + }finally{ + X11Lib.XUnlockDisplay(display); + } } finally { - X11Lib.XUnlockDisplay(display); NativeWindowFactory.getDefaultFactory().getToolkitLock().unlock(); } } @@ -85,14 +91,17 @@ public class X11GraphicsScreen extends DefaultGraphicsScreen implements Cloneabl private static int fetchScreen(X11GraphicsDevice device, int screen) { // It still could be an AWT hold handle .. NativeWindowFactory.getDefaultFactory().getToolkitLock().lock(); - long display = device.getHandle(); try { + long display = device.getHandle(); X11Lib.XLockDisplay(display); - if(X11Lib.XineramaEnabled(display)) { - screen = 0; // Xinerama -> 1 screen + try{ + if(X11Lib.XineramaEnabled(display)) { + screen = 0; // Xinerama -> 1 screen + } + }finally{ + X11Lib.XUnlockDisplay(display); } } finally { - X11Lib.XUnlockDisplay(display); NativeWindowFactory.getDefaultFactory().getToolkitLock().unlock(); } return screen; diff --git a/src/nativewindow/native/JAWT_DrawingSurfaceInfo.c b/src/nativewindow/native/JAWT_DrawingSurfaceInfo.c index e4afbdb70..a0422fa8e 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_sun_nativewindow_impl_jawt_JAWT_1DrawingSurfaceInfo_platformInfo0(JNIEnv* env, jobject unused, jobject jthis0) { +Java_com_jogamp_nativewindow_impl_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/JVM_Tool.c b/src/nativewindow/native/JVM_Tool.c deleted file mode 100644 index e04032aa2..000000000 --- a/src/nativewindow/native/JVM_Tool.c +++ /dev/null @@ -1,51 +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 - * MIDROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR - * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR - * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR - * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR - * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE - * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, - * 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. - */ - -#include <jni.h> - -JNIEXPORT jboolean JNICALL -Java_com_sun_nativewindow_impl_jvm_JVMUtil_initialize(JNIEnv *env, jclass _unused, jobject nioBuffer) { - int res; - void * ptr = NULL; - if (nioBuffer != NULL) { - ptr = (void *) (*env)->GetDirectBufferAddress(env, nioBuffer); - } - return ( NULL==ptr ) ? JNI_FALSE : JNI_TRUE ; -} - diff --git a/src/nativewindow/native/x11/Xmisc.c b/src/nativewindow/native/x11/Xmisc.c new file mode 100644 index 000000000..52449ae84 --- /dev/null +++ b/src/nativewindow/native/x11/Xmisc.c @@ -0,0 +1,493 @@ +/* + * Copyright (c) 2010 Sven Gothel. All Rights Reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * - Redistribution of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistribution in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * Neither the name Sven Gothel or the names of + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * This software is provided "AS IS," without a warranty of any kind. ALL + * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, + * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN + * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR + * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR + * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR + * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR + * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE + * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, + * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF + * SVEN GOTHEL HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + */ + +#include <stdlib.h> +#include <stdio.h> +#include <string.h> +#include <stdarg.h> +#include <unistd.h> +#include <X11/Xlib.h> +#include <X11/Xutil.h> +/* Linux headers don't work properly */ +#define __USE_GNU +#include <dlfcn.h> +#undef __USE_GNU + +/* Current versions of Solaris don't expose the XF86 extensions, + although with the recent transition to Xorg this will probably + happen in an upcoming release */ +#if !defined(__sun) && !defined(_HPUX) +#include <X11/extensions/xf86vmode.h> +#else +/* Need to provide stubs for these */ +Bool XF86VidModeGetGammaRampSize( + Display *display, + int screen, + int* size) +{ + return False; +} + +Bool XF86VidModeGetGammaRamp( + Display *display, + int screen, + int size, + unsigned short *red_array, + unsigned short *green_array, + unsigned short *blue_array) { + return False; +} +Bool XF86VidModeSetGammaRamp( + Display *display, + int screen, + int size, + unsigned short *red_array, + unsigned short *green_array, + unsigned short *blue_array) { + return False; +} +#endif /* defined(__sun) || defined(_HPUX) */ + +/* HP-UX doesn't define RTLD_DEFAULT. */ +#if defined(_HPUX) && !defined(RTLD_DEFAULT) +#define RTLD_DEFAULT NULL +#endif + +#include "com_jogamp_nativewindow_impl_x11_X11Lib.h" + +// #define VERBOSE_ON 1 + +#ifdef VERBOSE_ON + // Workaround for ancient compiler on Solaris/SPARC + // #define DBG_PRINT(args...) fprintf(stderr, args); + #define DBG_PRINT0(str) fprintf(stderr, str); + #define DBG_PRINT1(str, arg1) fprintf(stderr, str, arg1); + #define DBG_PRINT2(str, arg1, arg2) fprintf(stderr, str, arg1, arg2); + #define DBG_PRINT3(str, arg1, arg2, arg3) fprintf(stderr, str, arg1, arg2, arg3); + #define DBG_PRINT4(str, arg1, arg2, arg3, arg4) fprintf(stderr, str, arg1, arg2, arg3, arg4); + #define DBG_PRINT5(str, arg1, arg2, arg3, arg4, arg5) fprintf(stderr, str, arg1, arg2, arg3, arg4, arg5); + #define DBG_PRINT6(str, arg1, arg2, arg3, arg4, arg5, arg6) fprintf(stderr, str, arg1, arg2, arg3, arg4, arg5, arg6); + #define DBG_PRINT7(str, arg1, arg2, arg3, arg4, arg5, arg6, arg7) fprintf(stderr, str, arg1, arg2, arg3, arg4, arg5, arg6, arg7); + #define DBG_PRINT8(str, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) fprintf(stderr, str, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8); + +#else + + // Workaround for ancient compiler on Solaris/SPARC + // #define DBG_PRINT(args...) + #define DBG_PRINT0(str) + #define DBG_PRINT1(str, arg1) + #define DBG_PRINT2(str, arg1, arg2) + #define DBG_PRINT3(str, arg1, arg2, arg3) + #define DBG_PRINT4(str, arg1, arg2, arg3, arg4) + #define DBG_PRINT5(str, arg1, arg2, arg3, arg4, arg5) + #define DBG_PRINT6(str, arg1, arg2, arg3, arg4, arg5, arg6) + #define DBG_PRINT7(str, arg1, arg2, arg3, arg4, arg5, arg6, arg7) + #define DBG_PRINT8(str, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) + +#endif + +/* 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, buffer); + fprintf(stderr, "\n"); + (*env)->FatalError(env, buffer); +} + +static const char * const ClazzNameInternalBufferUtil = "com/jogamp/nativewindow/impl/InternalBufferUtil"; +static const char * const ClazzNameInternalBufferUtilStaticCstrName = "copyByteBuffer"; +static const char * const ClazzNameInternalBufferUtilStaticCstrSignature = "(Ljava/nio/ByteBuffer;)Ljava/nio/ByteBuffer;"; +static const char * const ClazzNameByteBuffer = "java/nio/ByteBuffer"; +static const char * const ClazzNameRuntimeException = "java/lang/RuntimeException"; +static jclass clazzInternalBufferUtil = NULL; +static jmethodID cstrInternalBufferUtil = NULL; +static jclass clazzByteBuffer = NULL; +static jclass clazzRuntimeException=NULL; + +static void _initClazzAccess(JNIEnv *env) { + jclass c; + + if(NULL!=clazzRuntimeException) return ; + + c = (*env)->FindClass(env, ClazzNameRuntimeException); + if(NULL==c) { + _FatalError(env, "Nativewindow X11Lib: can't find %s", ClazzNameRuntimeException); + } + clazzRuntimeException = (jclass)(*env)->NewGlobalRef(env, c); + (*env)->DeleteLocalRef(env, c); + if(NULL==clazzRuntimeException) { + _FatalError(env, "FatalError: NEWT X11Window: can't use %s", ClazzNameRuntimeException); + } + + c = (*env)->FindClass(env, ClazzNameInternalBufferUtil); + if(NULL==c) { + _FatalError(env, "FatalError: Java_com_jogamp_nativewindow_impl_x11_X11Lib: can't find %s", ClazzNameInternalBufferUtil); + } + clazzInternalBufferUtil = (jclass)(*env)->NewGlobalRef(env, c); + (*env)->DeleteLocalRef(env, c); + if(NULL==clazzInternalBufferUtil) { + _FatalError(env, "FatalError: Java_com_jogamp_nativewindow_impl_x11_X11Lib: can't use %s", ClazzNameInternalBufferUtil); + } + c = (*env)->FindClass(env, ClazzNameByteBuffer); + if(NULL==c) { + _FatalError(env, "FatalError: Java_com_jogamp_nativewindow_impl_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); + } + + cstrInternalBufferUtil = (*env)->GetStaticMethodID(env, clazzInternalBufferUtil, + ClazzNameInternalBufferUtilStaticCstrName, ClazzNameInternalBufferUtilStaticCstrSignature); + if(NULL==cstrInternalBufferUtil) { + _FatalError(env, "FatalError: Java_com_jogamp_nativewindow_impl_x11_X11Lib:: can't create %s.%s %s", + ClazzNameInternalBufferUtil, ClazzNameInternalBufferUtilStaticCstrName, ClazzNameInternalBufferUtilStaticCstrSignature); + } +} + +static void _throwNewRuntimeException(Display * unlockDisplay, JNIEnv *env, const char* msg, ...) +{ + char buffer[512]; + va_list ap; + + if(NULL!=unlockDisplay) { + XUnlockDisplay(unlockDisplay); + } + + _initClazzAccess(env); + + 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 x11ErrorHandler(Display *dpy, XErrorEvent *e) +{ + _throwNewRuntimeException(NULL, x11ErrorHandlerJNIEnv, "Nativewindow X11 Error: Display %p, Code 0x%X", dpy, e->error_code); + + return 0; +} + +static void x11ErrorHandlerEnable(int onoff, JNIEnv * env) { + if(onoff) { + if(NULL==origErrorHandler) { + x11ErrorHandlerJNIEnv = env; + origErrorHandler = XSetErrorHandler(x11ErrorHandler); + } + } else { + XSetErrorHandler(origErrorHandler); + origErrorHandler = NULL; + } +} + + +static XIOErrorHandler origIOErrorHandler = NULL; + +static int x11IOErrorHandler(Display *dpy) +{ + _FatalError(x11ErrorHandlerJNIEnv, "Nativewindow X11 IOError: Display %p not available", dpy); + origIOErrorHandler(dpy); + return 0; +} + +static void x11IOErrorHandlerEnable(int onoff, JNIEnv * env) { + if(onoff) { + if(NULL==origIOErrorHandler) { + x11ErrorHandlerJNIEnv = env; + origIOErrorHandler = XSetIOErrorHandler(x11IOErrorHandler); + } + } else { + XSetIOErrorHandler(origIOErrorHandler); + origIOErrorHandler = NULL; + } +} + +JNIEXPORT void JNICALL +Java_com_jogamp_nativewindow_impl_x11_X11Util_installIOErrorHandler(JNIEnv *env, jclass _unused) { + x11ErrorHandlerEnable(1, env); + x11IOErrorHandlerEnable(1, env); +} + +JNIEXPORT jlong JNICALL +Java_com_jogamp_nativewindow_impl_x11_X11Lib_dlopen(JNIEnv *env, jclass _unused, jstring name) { + const jbyte* chars; + void* res; + chars = (*env)->GetStringUTFChars(env, name, NULL); + res = dlopen(chars, RTLD_LAZY | RTLD_GLOBAL); + (*env)->ReleaseStringUTFChars(env, name, chars); + return (jlong) ((intptr_t) res); +} + +JNIEXPORT jlong JNICALL +Java_com_jogamp_nativewindow_impl_x11_X11Lib_dlsym(JNIEnv *env, jclass _unused, jstring name) { + const jbyte* chars; + void* res; + chars = (*env)->GetStringUTFChars(env, name, NULL); + res = dlsym(RTLD_DEFAULT, chars); + (*env)->ReleaseStringUTFChars(env, name, chars); + return (jlong) ((intptr_t) res); +} + +/* Java->C glue code: + * Java package: com.jogamp.nativewindow.impl.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_XGetVisualInfoCopied1__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; + int count; + jobject jbyteSource; + jobject jbyteCopy; + if(0==arg0) { + _FatalError(env, "invalid display connection.."); + } + if (arg2 != NULL) { + _ptr2 = (XVisualInfo *) (((char*) (*env)->GetDirectBufferAddress(env, arg2)) + 0); + } + if (arg3 != NULL) { + _ptr3 = (int *) (((char*) (*env)->GetPrimitiveArrayCritical(env, arg3, NULL)) + arg3_byte_offset); + } + _res = XGetVisualInfo((Display *) (intptr_t) arg0, (long) arg1, (XVisualInfo *) _ptr2, (int *) _ptr3); + count = _ptr3[0]; + if (arg3 != NULL) { + (*env)->ReleasePrimitiveArrayCritical(env, arg3, _ptr3, 0); + } + if (_res == NULL) return NULL; + + _initClazzAccess(env); + + jbyteSource = (*env)->NewDirectByteBuffer(env, _res, count * sizeof(XVisualInfo)); + jbyteCopy = (*env)->CallStaticObjectMethod(env, + clazzInternalBufferUtil, cstrInternalBufferUtil, jbyteSource); + + XFree(_res); + + return jbyteCopy; +} + +JNIEXPORT jlong JNICALL +Java_com_jogamp_nativewindow_impl_x11_X11Lib_DefaultVisualID(JNIEnv *env, jclass _unused, jlong display, jint screen) { + jlong r; + if(0==display) { + _FatalError(env, "invalid display connection.."); + } + r = (jlong) XVisualIDFromVisual( DefaultVisual( (Display*) (intptr_t) display, screen ) ); + return r; +} + +/* Java->C glue code: + * Java package: com.jogamp.nativewindow.impl.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) { + if(0==display) { + _FatalError(env, "invalid display connection.."); + } + XLockDisplay((Display *) (intptr_t) display); +} + +/* Java->C glue code: + * Java package: com.jogamp.nativewindow.impl.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) { + if(0==display) { + _FatalError(env, "invalid display connection.."); + } + XUnlockDisplay((Display *) (intptr_t) display); +} + + +/* Java->C glue code: + * Java package: com.jogamp.nativewindow.impl.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) { + int _res; + if(0==display) { + _FatalError(env, "invalid display connection.."); + } + _res = XCloseDisplay((Display *) (intptr_t) display); + return _res; +} + +/* + * Class: com_jogamp_nativewindow_impl_x11_X11Lib + * Method: CreateDummyWindow + * Signature: (JIJ)J + */ +JNIEXPORT jlong JNICALL Java_com_jogamp_nativewindow_impl_x11_X11Lib_CreateDummyWindow + (JNIEnv *env, jobject obj, jlong display, jint screen_index, jlong visualID) +{ + Display * dpy = (Display *)(intptr_t)display; + int scrn_idx = (int)screen_index; + Window windowParent = 0; + Window window = 0; + + XVisualInfo visualTemplate; + XVisualInfo *pVisualQuery = NULL; + Visual *visual = NULL; + int depth; + + XSetWindowAttributes xswa; + unsigned long attrMask; + int n; + + Screen* scrn; + + if(NULL==dpy) { + _FatalError(env, "invalid display connection.."); + return 0; + } + + if(visualID<0) { + _throwNewRuntimeException(NULL, env, "invalid VisualID .."); + return 0; + } + + XLockDisplay(dpy) ; + + XSync(dpy, False); + + scrn = ScreenOfDisplay(dpy, scrn_idx); + + // try given VisualID on screen + memset(&visualTemplate, 0, sizeof(XVisualInfo)); + visualTemplate.screen = scrn_idx; + visualTemplate.visualid = (VisualID)visualID; + pVisualQuery = XGetVisualInfo(dpy, VisualIDMask|VisualScreenMask, &visualTemplate,&n); + if(pVisualQuery!=NULL) { + visual = pVisualQuery->visual; + depth = pVisualQuery->depth; + visualID = (jlong)pVisualQuery->visualid; + XFree(pVisualQuery); + pVisualQuery=NULL; + } + DBG_PRINT5( "X11: [CreateWindow] trying given (dpy %p, screen %d, visualID: %d, parent %p) found: %p\n", dpy, scrn_idx, (int)visualID, windowParent, visual); + + if (visual==NULL) + { + _throwNewRuntimeException(dpy, env, "could not query Visual by given VisualID, bail out!"); + return 0; + } + + if(pVisualQuery!=NULL) { + XFree(pVisualQuery); + pVisualQuery=NULL; + } + + if(0==windowParent) { + windowParent = XRootWindowOfScreen(scrn); + } + + attrMask = (CWBackPixel | CWBorderPixel | CWColormap | CWOverrideRedirect) ; + + memset(&xswa, 0, sizeof(xswa)); + xswa.override_redirect = True; // not decorated + xswa.border_pixel = 0; + xswa.background_pixel = 0; + xswa.event_mask = 0 ; // no events + xswa.colormap = XCreateColormap(dpy, + XRootWindow(dpy, scrn_idx), + visual, + AllocNone); + + window = XCreateWindow(dpy, + windowParent, + 0, 0, + 64, 64, + 0, // border width + depth, + InputOutput, + visual, + attrMask, + &xswa); + + XSync(dpy, False); + + XUnlockDisplay(dpy) ; + + DBG_PRINT2( "X11: [CreateWindow] created window %p on display %p\n", window, dpy); + + return (jlong) window; +} + + +/* + * Class: com_jogamp_nativewindow_impl_x11_X11Lib + * Method: DestroyDummyWindow + * Signature: (JJ)V + */ +JNIEXPORT void JNICALL Java_com_jogamp_nativewindow_impl_x11_X11Lib_DestroyDummyWindow + (JNIEnv *env, jobject obj, jlong display, jlong window) +{ + Display * dpy = (Display *)(intptr_t)display; + Window w = (Window) window; + + if(NULL==dpy) { + _throwNewRuntimeException(NULL, env, "invalid display connection.."); + return; + } + XLockDisplay(dpy) ; + + XSync(dpy, False); + XUnmapWindow(dpy, w); + XSync(dpy, False); + XDestroyWindow(dpy, w); + XSync(dpy, False); + + XUnlockDisplay(dpy) ; +} diff --git a/src/newt/classes/com/sun/javafx/newt/Display.java b/src/newt/classes/com/jogamp/newt/Display.java index a4b7a4f51..2bc99475c 100755 --- a/src/newt/classes/com/sun/javafx/newt/Display.java +++ b/src/newt/classes/com/jogamp/newt/Display.java @@ -31,11 +31,11 @@ * */ -package com.sun.javafx.newt; +package com.jogamp.newt; import javax.media.nativewindow.*; -import com.sun.javafx.newt.impl.Debug; -import com.sun.javafx.newt.util.EventDispatchThread; +import com.jogamp.newt.impl.Debug; +import com.jogamp.newt.util.EDTUtil; import java.util.*; public abstract class Display { @@ -47,15 +47,15 @@ public abstract class Display { Class displayClass = NewtFactory.getCustomClass(type, "Display"); if(null==displayClass) { if (NativeWindowFactory.TYPE_EGL.equals(type)) { - displayClass = Class.forName("com.sun.javafx.newt.opengl.kd.KDDisplay"); + displayClass = Class.forName("com.jogamp.newt.opengl.kd.KDDisplay"); } else if (NativeWindowFactory.TYPE_WINDOWS.equals(type)) { - displayClass = Class.forName("com.sun.javafx.newt.windows.WindowsDisplay"); + displayClass = Class.forName("com.jogamp.newt.windows.WindowsDisplay"); } else if (NativeWindowFactory.TYPE_MACOSX.equals(type)) { - displayClass = Class.forName("com.sun.javafx.newt.macosx.MacDisplay"); + displayClass = Class.forName("com.jogamp.newt.macosx.MacDisplay"); } else if (NativeWindowFactory.TYPE_X11.equals(type)) { - displayClass = Class.forName("com.sun.javafx.newt.x11.X11Display"); + displayClass = Class.forName("com.jogamp.newt.x11.X11Display"); } else if (NativeWindowFactory.TYPE_AWT.equals(type)) { - displayClass = Class.forName("com.sun.javafx.newt.awt.AWTDisplay"); + displayClass = Class.forName("com.jogamp.newt.awt.AWTDisplay"); } else { throw new RuntimeException("Unknown display type \"" + type + "\""); } @@ -141,11 +141,16 @@ public abstract class Display { display.refCount=1; if(NewtFactory.useEDT()) { - Thread current = Thread.currentThread(); - display.eventDispatchThread = new EventDispatchThread(display, current.getThreadGroup(), current.getName()); - display.eventDispatchThread.start(); final Display f_dpy = display; - display.eventDispatchThread.invokeAndWait(new Runnable() { + Thread current = Thread.currentThread(); + display.edtUtil = new EDTUtil(current.getThreadGroup(), + "Display_"+display.getName()+"-"+current.getName(), + new Runnable() { + public void run() { + f_dpy.pumpMessagesImpl(); + } } ); + display.edt = display.edtUtil.start(); + display.edtUtil.invokeAndWait(new Runnable() { public void run() { f_dpy.createNative(); } @@ -189,7 +194,7 @@ public abstract class Display { } } - public EventDispatchThread getEDT() { return eventDispatchThread; } + public EDTUtil getEDTUtil() { return edtUtil; } public synchronized void destroy() { if(DEBUG) { @@ -201,10 +206,10 @@ public abstract class Display { if(DEBUG) { System.err.println("Display.destroy("+name+") REMOVE: "+this+" "+Thread.currentThread()); } - if(null!=eventDispatchThread) { + if(null!=edtUtil) { final Display f_dpy = this; - final EventDispatchThread f_edt = eventDispatchThread; - eventDispatchThread.invokeAndWait(new Runnable() { + final EDTUtil f_edt = edtUtil; + edtUtil.invokeAndWait(new Runnable() { public void run() { f_dpy.closeNative(); f_edt.stop(); @@ -213,9 +218,9 @@ public abstract class Display { } else { closeNative(); } - if(null!=eventDispatchThread) { - eventDispatchThread.waitUntilStopped(); - eventDispatchThread=null; + if(null!=edtUtil) { + edtUtil.waitUntilStopped(); + edtUtil=null; } aDevice = null; } else { @@ -246,14 +251,13 @@ public abstract class Display { return aDevice; } - public void pumpMessages() { - if(null!=eventDispatchThread) { - dispatchMessages(); - } else { - synchronized(this) { - dispatchMessages(); - } - } + public synchronized void pumpMessages() { + pumpMessagesImpl(); + } + + private void pumpMessagesImpl() { + if(0==refCount) return; + dispatchMessages(); } public String toString() { @@ -268,7 +272,8 @@ public abstract class Display { /** Default impl. nop - Currently only X11 needs a Display lock */ protected void unlockDisplay() { } - protected EventDispatchThread eventDispatchThread = null; + protected EDTUtil edtUtil = null; + protected Thread edt = null; protected String name; protected int refCount; protected AbstractGraphicsDevice aDevice; diff --git a/src/newt/classes/com/sun/javafx/newt/Event.java b/src/newt/classes/com/jogamp/newt/Event.java index 3c045c52b..d42a95735 100644 --- a/src/newt/classes/com/sun/javafx/newt/Event.java +++ b/src/newt/classes/com/jogamp/newt/Event.java @@ -31,7 +31,7 @@ * */ -package com.sun.javafx.newt; +package com.jogamp.newt; public class Event { private boolean isSystemEvent; diff --git a/src/newt/classes/com/sun/javafx/newt/EventListener.java b/src/newt/classes/com/jogamp/newt/EventListener.java index a312752fe..75cb487dd 100644 --- a/src/newt/classes/com/sun/javafx/newt/EventListener.java +++ b/src/newt/classes/com/jogamp/newt/EventListener.java @@ -31,7 +31,7 @@ * */ -package com.sun.javafx.newt; +package com.jogamp.newt; public interface EventListener { diff --git a/src/newt/classes/com/sun/javafx/newt/InputEvent.java b/src/newt/classes/com/jogamp/newt/InputEvent.java index b49c72e75..d4c3f6905 100644 --- a/src/newt/classes/com/sun/javafx/newt/InputEvent.java +++ b/src/newt/classes/com/jogamp/newt/InputEvent.java @@ -31,7 +31,7 @@ * */ -package com.sun.javafx.newt; +package com.jogamp.newt; public abstract class InputEvent extends Event { diff --git a/src/newt/classes/com/sun/javafx/newt/Insets.java b/src/newt/classes/com/jogamp/newt/Insets.java index 7d379cd92..e440892f0 100644 --- a/src/newt/classes/com/sun/javafx/newt/Insets.java +++ b/src/newt/classes/com/jogamp/newt/Insets.java @@ -30,7 +30,7 @@ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. * */ -package com.sun.javafx.newt; +package com.jogamp.newt; /** * Simple class representing insets. diff --git a/src/newt/classes/com/sun/javafx/newt/KeyEvent.java b/src/newt/classes/com/jogamp/newt/KeyEvent.java index c7450da67..bec77160b 100644 --- a/src/newt/classes/com/sun/javafx/newt/KeyEvent.java +++ b/src/newt/classes/com/jogamp/newt/KeyEvent.java @@ -31,7 +31,7 @@ * */ -package com.sun.javafx.newt; +package com.jogamp.newt; public class KeyEvent extends InputEvent { diff --git a/src/newt/classes/com/sun/javafx/newt/KeyListener.java b/src/newt/classes/com/jogamp/newt/KeyListener.java index 6f022c45a..28e2b833b 100644 --- a/src/newt/classes/com/sun/javafx/newt/KeyListener.java +++ b/src/newt/classes/com/jogamp/newt/KeyListener.java @@ -31,7 +31,7 @@ * */ -package com.sun.javafx.newt; +package com.jogamp.newt; public interface KeyListener extends EventListener { diff --git a/src/newt/classes/com/sun/javafx/newt/MouseEvent.java b/src/newt/classes/com/jogamp/newt/MouseEvent.java index ede193e1c..d5412c0cc 100644 --- a/src/newt/classes/com/sun/javafx/newt/MouseEvent.java +++ b/src/newt/classes/com/jogamp/newt/MouseEvent.java @@ -31,7 +31,7 @@ * */ -package com.sun.javafx.newt; +package com.jogamp.newt; public class MouseEvent extends InputEvent { diff --git a/src/newt/classes/com/sun/javafx/newt/MouseListener.java b/src/newt/classes/com/jogamp/newt/MouseListener.java index 3d2031f2a..6d931dd31 100644 --- a/src/newt/classes/com/sun/javafx/newt/MouseListener.java +++ b/src/newt/classes/com/jogamp/newt/MouseListener.java @@ -31,7 +31,7 @@ * */ -package com.sun.javafx.newt; +package com.jogamp.newt; public interface MouseListener extends EventListener { diff --git a/src/newt/classes/com/sun/javafx/newt/NewtFactory.java b/src/newt/classes/com/jogamp/newt/NewtFactory.java index 6e25b19eb..2d5c10c52 100755 --- a/src/newt/classes/com/sun/javafx/newt/NewtFactory.java +++ b/src/newt/classes/com/jogamp/newt/NewtFactory.java @@ -31,12 +31,12 @@ * */ -package com.sun.javafx.newt; +package com.jogamp.newt; import javax.media.nativewindow.*; import java.util.ArrayList; import java.util.Iterator; -import com.sun.nativewindow.impl.jvm.JVMUtil; +import com.jogamp.common.jvm.JVMUtil; public abstract class NewtFactory { // Work-around for initialization order problems on Mac OS X diff --git a/src/newt/classes/com/sun/javafx/newt/OffscreenWindow.java b/src/newt/classes/com/jogamp/newt/OffscreenWindow.java index 11ce8e6c7..c9c56fc61 100644 --- a/src/newt/classes/com/sun/javafx/newt/OffscreenWindow.java +++ b/src/newt/classes/com/jogamp/newt/OffscreenWindow.java @@ -31,7 +31,7 @@ * */ -package com.sun.javafx.newt; +package com.jogamp.newt; import javax.media.nativewindow.*; diff --git a/src/newt/classes/com/sun/javafx/newt/PaintEvent.java b/src/newt/classes/com/jogamp/newt/PaintEvent.java index b27b969da..51c43725a 100755 --- a/src/newt/classes/com/sun/javafx/newt/PaintEvent.java +++ b/src/newt/classes/com/jogamp/newt/PaintEvent.java @@ -31,7 +31,7 @@ * */ -package com.sun.javafx.newt; +package com.jogamp.newt; /** * diff --git a/src/newt/classes/com/sun/javafx/newt/PaintListener.java b/src/newt/classes/com/jogamp/newt/PaintListener.java index fab5fa35c..6fbc9c8fc 100755 --- a/src/newt/classes/com/sun/javafx/newt/PaintListener.java +++ b/src/newt/classes/com/jogamp/newt/PaintListener.java @@ -31,7 +31,7 @@ * */ -package com.sun.javafx.newt; +package com.jogamp.newt; /** * diff --git a/src/newt/classes/com/sun/javafx/newt/Screen.java b/src/newt/classes/com/jogamp/newt/Screen.java index 9edd0b719..b393d30de 100755 --- a/src/newt/classes/com/sun/javafx/newt/Screen.java +++ b/src/newt/classes/com/jogamp/newt/Screen.java @@ -31,9 +31,9 @@ * */ -package com.sun.javafx.newt; +package com.jogamp.newt; -import com.sun.javafx.newt.impl.*; +import com.jogamp.newt.impl.*; import javax.media.nativewindow.*; import java.security.*; @@ -46,15 +46,15 @@ public abstract class Screen { Class screenClass = NewtFactory.getCustomClass(type, "Screen"); if(null==screenClass) { if (NativeWindowFactory.TYPE_EGL.equals(type)) { - screenClass = Class.forName("com.sun.javafx.newt.opengl.kd.KDScreen"); + screenClass = Class.forName("com.jogamp.newt.opengl.kd.KDScreen"); } else if (NativeWindowFactory.TYPE_WINDOWS.equals(type)) { - screenClass = Class.forName("com.sun.javafx.newt.windows.WindowsScreen"); + screenClass = Class.forName("com.jogamp.newt.windows.WindowsScreen"); } else if (NativeWindowFactory.TYPE_MACOSX.equals(type)) { - screenClass = Class.forName("com.sun.javafx.newt.macosx.MacScreen"); + screenClass = Class.forName("com.jogamp.newt.macosx.MacScreen"); } else if (NativeWindowFactory.TYPE_X11.equals(type)) { - screenClass = Class.forName("com.sun.javafx.newt.x11.X11Screen"); + screenClass = Class.forName("com.jogamp.newt.x11.X11Screen"); } else if (NativeWindowFactory.TYPE_AWT.equals(type)) { - screenClass = Class.forName("com.sun.javafx.newt.awt.AWTScreen"); + screenClass = Class.forName("com.jogamp.newt.awt.AWTScreen"); } else { throw new RuntimeException("Unknown window type \"" + type + "\""); } diff --git a/src/newt/classes/com/sun/javafx/newt/Window.java b/src/newt/classes/com/jogamp/newt/Window.java index 58bd251d2..b1f8b3977 100755 --- a/src/newt/classes/com/sun/javafx/newt/Window.java +++ b/src/newt/classes/com/jogamp/newt/Window.java @@ -31,13 +31,13 @@ * */ -package com.sun.javafx.newt; +package com.jogamp.newt; -import com.sun.javafx.newt.impl.Debug; -import com.sun.javafx.newt.util.EventDispatchThread; +import com.jogamp.newt.impl.Debug; +import com.jogamp.newt.util.EDTUtil; +import com.jogamp.common.util.*; import javax.media.nativewindow.*; -import com.sun.nativewindow.impl.NWReflection; import java.util.ArrayList; import java.util.Iterator; @@ -70,15 +70,15 @@ public abstract class Window implements NativeWindow Class windowClass = NewtFactory.getCustomClass(type, "Window"); if(null==windowClass) { if (NativeWindowFactory.TYPE_EGL.equals(type)) { - windowClass = Class.forName("com.sun.javafx.newt.opengl.kd.KDWindow"); + windowClass = Class.forName("com.jogamp.newt.opengl.kd.KDWindow"); } else if (NativeWindowFactory.TYPE_WINDOWS.equals(type)) { - windowClass = Class.forName("com.sun.javafx.newt.windows.WindowsWindow"); + windowClass = Class.forName("com.jogamp.newt.windows.WindowsWindow"); } else if (NativeWindowFactory.TYPE_MACOSX.equals(type)) { - windowClass = Class.forName("com.sun.javafx.newt.macosx.MacWindow"); + windowClass = Class.forName("com.jogamp.newt.macosx.MacWindow"); } else if (NativeWindowFactory.TYPE_X11.equals(type)) { - windowClass = Class.forName("com.sun.javafx.newt.x11.X11Window"); + windowClass = Class.forName("com.jogamp.newt.x11.X11Window"); } else if (NativeWindowFactory.TYPE_AWT.equals(type)) { - windowClass = Class.forName("com.sun.javafx.newt.awt.AWTWindow"); + windowClass = Class.forName("com.jogamp.newt.awt.AWTWindow"); } else { throw new NativeWindowException("Unknown window type \"" + type + "\""); } @@ -98,10 +98,10 @@ public abstract class Window implements NativeWindow window.invalidate(); window.screen = screen; window.setUndecorated(undecorated||0!=parentWindowHandle); - EventDispatchThread edt = screen.getDisplay().getEDT(); - if(null!=edt) { + EDTUtil edtUtil = screen.getDisplay().getEDTUtil(); + if(null!=edtUtil) { final Window f_win = window; - edt.invokeAndWait(new Runnable() { + edtUtil.invokeAndWait(new Runnable() { public void run() { f_win.createNative(parentWindowHandle, caps); } @@ -109,6 +109,9 @@ public abstract class Window implements NativeWindow } else { window.createNative(parentWindowHandle, caps); } + if(DEBUG_WINDOW_EVENT) { + System.out.println("Window.create-1() done ("+Thread.currentThread()+", "+window+")"); + } return window; } catch (Throwable t) { t.printStackTrace(); @@ -127,14 +130,14 @@ public abstract class Window implements NativeWindow if ( argsChecked < cstrArguments.length ) { throw new NativeWindowException("WindowClass "+windowClass+" constructor mismatch at argument #"+argsChecked+"; Constructor: "+getTypeStrList(cstrArgumentTypes)+", arguments: "+getArgsStrList(cstrArguments)); } - Window window = (Window) NWReflection.createInstance( windowClass, cstrArgumentTypes, cstrArguments ) ; + Window window = (Window) ReflectionUtil.createInstance( windowClass, cstrArgumentTypes, cstrArguments ) ; window.invalidate(); window.screen = screen; window.setUndecorated(undecorated); - EventDispatchThread edt = screen.getDisplay().getEDT(); - if(null!=edt) { + EDTUtil edtUtil = screen.getDisplay().getEDTUtil(); + if(null!=edtUtil) { final Window f_win = window; - edt.invokeAndWait(new Runnable() { + edtUtil.invokeAndWait(new Runnable() { public void run() { f_win.createNative(0, caps); } @@ -142,9 +145,11 @@ public abstract class Window implements NativeWindow } else { window.createNative(0, caps); } + if(DEBUG_WINDOW_EVENT) { + System.out.println("Window.create-2() done ("+Thread.currentThread()+", "+window+")"); + } return window; } catch (Throwable t) { - t.printStackTrace(); throw new NativeWindowException(t); } } @@ -212,15 +217,15 @@ public abstract class Window implements NativeWindow public String toString() { StringBuffer sb = new StringBuffer(); - sb.append(getClass().getName()+"[config "+config+ - ", windowHandle "+toHexString(getWindowHandle())+ - ", surfaceHandle "+toHexString(getSurfaceHandle())+ - ", pos "+getX()+"/"+getY()+", size "+getWidth()+"x"+getHeight()+ - ", visible "+isVisible()+ - ", undecorated "+undecorated+ - ", fullscreen "+fullscreen+ - ", "+screen+ - ", wrappedWindow "+getWrappedWindow()); + sb.append(getClass().getName()+"[Config "+config+ + "\n, "+screen+ + "\n, WindowHandle "+toHexString(getWindowHandle())+ + "\n, SurfaceHandle "+toHexString(getSurfaceHandle())+ + "\n, Pos "+getX()+"/"+getY()+", size "+getWidth()+"x"+getHeight()+ + "\n, Visible "+isVisible()+ + "\n, Undecorated "+undecorated+ + "\n, Fullscreen "+fullscreen+ + "\n, WrappedWindow "+getWrappedWindow()); sb.append(", SurfaceUpdatedListeners num "+surfaceUpdatedListeners.size()+" ["); for (Iterator iter = surfaceUpdatedListeners.iterator(); iter.hasNext(); ) { @@ -264,71 +269,48 @@ public abstract class Window implements NativeWindow // // NativeWindow impl // - private Thread owner; - private int recursionCount; - protected Exception lockedStack = null; /** Recursive and blocking lockSurface() implementation */ public synchronized int lockSurface() { // We leave the ToolkitLock lock to the specializtion's discretion, // ie the implicit JAWTWindow in case of AWTWindow - Thread cur = Thread.currentThread(); - if (owner == cur) { - ++recursionCount; - return LOCK_SUCCESS; - } - while (owner != null) { - try { - wait(); - } catch (InterruptedException e) { - throw new RuntimeException(e); - } - } - owner = cur; - lockedStack = new Exception("NEWT Surface previously locked by "+Thread.currentThread()); + surfaceLock.lock(); screen.getDisplay().lockDisplay(); return LOCK_SUCCESS; } /** Recursive and unblocking unlockSurface() implementation */ public synchronized void unlockSurface() throws NativeWindowException { - Thread cur = Thread.currentThread(); - if (owner != cur) { - lockedStack.printStackTrace(); - throw new NativeWindowException(cur+": Not owner, owner is "+owner); - } - if (recursionCount > 0) { - --recursionCount; - return; - } - owner = null; - lockedStack = null; - screen.getDisplay().unlockDisplay(); - notifyAll(); + surfaceLock.unlock( new Runnable() { + final Screen f_screen = screen; + public void run() { + screen.getDisplay().unlockDisplay(); + } + } ); // We leave the ToolkitLock unlock to the specializtion's discretion, // ie the implicit JAWTWindow in case of AWTWindow } public synchronized boolean isSurfaceLocked() { - return null!=owner; + return surfaceLock.isLocked(); } public synchronized Thread getSurfaceLockOwner() { - return owner; + return surfaceLock.getOwner(); } public synchronized Exception getLockedStack() { - return lockedStack; + return surfaceLock.getLockedStack(); } - public synchronized void destroy() { + public void destroy() { destroy(false); } /** @param deep If true, the linked Screen and Display will be destroyed as well. */ - public synchronized void destroy(boolean deep) { + public void destroy(boolean deep) { if(DEBUG_WINDOW_EVENT) { - System.out.println("Window.destroy() start (deep "+deep+" - "+Thread.currentThread()); + System.out.println("Window.destroy() start (deep "+deep+" - "+Thread.currentThread()+", "+this+")"); } synchronized(surfaceUpdatedListeners) { surfaceUpdatedListeners = new ArrayList(); @@ -342,26 +324,36 @@ public abstract class Window implements NativeWindow synchronized(keyListeners) { keyListeners = new ArrayList(); } - Screen scr = screen; - Display dpy = (null!=screen) ? screen.getDisplay() : null; - EventDispatchThread edt = (null!=dpy) ? dpy.getEDT() : null; - if(null!=edt) { - final Window f_win = this; - edt.invokeAndWait(new Runnable() { - public void run() { - f_win.closeNative(); + synchronized(this) { + destructionLock.lock(); + try { + Display dpy = null; + if( null != screen && 0 != windowHandle ) { + Screen scr = screen; + dpy = (null!=screen) ? screen.getDisplay() : null; + EDTUtil edtUtil = (null!=dpy) ? dpy.getEDTUtil() : null; + if(null!=edtUtil) { + final Window f_win = this; + edtUtil.invokeAndWait(new Runnable() { + public void run() { + f_win.closeNative(); + } + } ); + } else { + closeNative(); + } } - } ); - } else { - closeNative(); - } - invalidate(); - if(deep) { - if(null!=scr) { - scr.destroy(); - } - if(null!=dpy) { - dpy.destroy(); + invalidate(); + if(deep) { + if(null!=screen) { + screen.destroy(); + } + if(null!=dpy) { + dpy.destroy(); + } + } + } finally { + destructionLock.unlock(); } } if(DEBUG_WINDOW_EVENT) { @@ -487,12 +479,12 @@ public abstract class Window implements NativeWindow protected void windowDestroyNotify() { if(DEBUG_WINDOW_EVENT) { - System.out.println("Window.windowDestroyeNotify start "+Thread.currentThread()); + System.out.println("Window.windowDestroyNotify start "+Thread.currentThread()); } sendWindowEvent(WindowEvent.EVENT_WINDOW_DESTROY_NOTIFY); - if(!autoDrawableMember) { + if(!autoDrawableMember && !destructionLock.isLocked()) { destroy(); } @@ -505,7 +497,9 @@ public abstract class Window implements NativeWindow if(DEBUG_WINDOW_EVENT) { System.out.println("Window.windowDestroyed "+Thread.currentThread()); } - invalidate(); + if(!destructionLock.isLocked()) { + invalidate(); + } } public abstract void setVisible(boolean visible); @@ -554,6 +548,12 @@ public abstract class Window implements NativeWindow } } + public void removeAllSurfaceUpdatedListener() { + synchronized(surfaceUpdatedListeners) { + surfaceUpdatedListeners = new ArrayList(); + } + } + public SurfaceUpdatedListener[] getSurfaceUpdatedListener() { synchronized(surfaceUpdatedListeners) { return (SurfaceUpdatedListener[]) surfaceUpdatedListeners.toArray(); @@ -926,4 +926,78 @@ public abstract class Window implements NativeWindow } return sb.toString(); } + + // + // Reentrance locking toolkit + // + public static class WindowToolkitLock implements ToolkitLock { + private Thread owner; + private int recursionCount; + private Exception lockedStack = null; + + public Exception getLockedStack() { + return lockedStack; + } + + public Thread getOwner() { + return owner; + } + + public boolean isOwner() { + return isOwner(Thread.currentThread()); + } + + public synchronized boolean isOwner(Thread thread) { + return owner == thread ; + } + + public synchronized boolean isLocked() { + return null != owner; + } + + /** Recursive and blocking lockSurface() implementation */ + public synchronized void lock() { + Thread cur = Thread.currentThread(); + if (owner == cur) { + ++recursionCount; + } + while (owner != null) { + try { + wait(); + } catch (InterruptedException e) { + throw new RuntimeException(e); + } + } + owner = cur; + lockedStack = new Exception("Previously locked by "+owner); + } + + + /** Recursive and unblocking unlockSurface() implementation */ + public synchronized void unlock() { + unlock(null); + } + + /** Recursive and unblocking unlockSurface() implementation */ + public synchronized void unlock(Runnable releaseAfterUnlockBeforeNotify) { + Thread cur = Thread.currentThread(); + if (owner != cur) { + lockedStack.printStackTrace(); + throw new RuntimeException(cur+": Not owner, owner is "+owner); + } + if (recursionCount > 0) { + --recursionCount; + return; + } + owner = null; + lockedStack = null; + if(null!=releaseAfterUnlockBeforeNotify) { + releaseAfterUnlockBeforeNotify.run(); + } + notifyAll(); + } + } + private WindowToolkitLock destructionLock = new WindowToolkitLock(); + private WindowToolkitLock surfaceLock = new WindowToolkitLock(); } + diff --git a/src/newt/classes/com/sun/javafx/newt/WindowEvent.java b/src/newt/classes/com/jogamp/newt/WindowEvent.java index c5aa65e3d..1189401af 100644 --- a/src/newt/classes/com/sun/javafx/newt/WindowEvent.java +++ b/src/newt/classes/com/jogamp/newt/WindowEvent.java @@ -31,7 +31,7 @@ * */ -package com.sun.javafx.newt; +package com.jogamp.newt; public class WindowEvent extends Event { public static final int EVENT_WINDOW_RESIZED = 100; diff --git a/src/newt/classes/com/sun/javafx/newt/WindowListener.java b/src/newt/classes/com/jogamp/newt/WindowListener.java index 81624fa75..0ec63435c 100644 --- a/src/newt/classes/com/sun/javafx/newt/WindowListener.java +++ b/src/newt/classes/com/jogamp/newt/WindowListener.java @@ -31,7 +31,7 @@ * */ -package com.sun.javafx.newt; +package com.jogamp.newt; public interface WindowListener extends EventListener { public void windowResized(WindowEvent e); diff --git a/src/newt/classes/com/sun/javafx/newt/awt/AWTCanvas.java b/src/newt/classes/com/jogamp/newt/awt/AWTCanvas.java index 6b8fc43c7..f6ea9acc3 100644 --- a/src/newt/classes/com/sun/javafx/newt/awt/AWTCanvas.java +++ b/src/newt/classes/com/jogamp/newt/awt/AWTCanvas.java @@ -31,9 +31,9 @@ * */ -package com.sun.javafx.newt.awt; +package com.jogamp.newt.awt; -import com.sun.javafx.newt.Window; +import com.jogamp.newt.Window; import java.awt.Canvas; import java.awt.GraphicsDevice; @@ -42,7 +42,7 @@ import java.awt.GraphicsConfiguration; import javax.media.nativewindow.*; import javax.media.nativewindow.awt.*; -import com.sun.javafx.newt.impl.Debug; +import com.jogamp.newt.impl.Debug; import java.lang.reflect.Method; import java.security.AccessController; import java.security.PrivilegedAction; diff --git a/src/newt/classes/com/sun/javafx/newt/awt/AWTDisplay.java b/src/newt/classes/com/jogamp/newt/awt/AWTDisplay.java index 19f3ed1a8..09ce10017 100644 --- a/src/newt/classes/com/sun/javafx/newt/awt/AWTDisplay.java +++ b/src/newt/classes/com/jogamp/newt/awt/AWTDisplay.java @@ -31,11 +31,11 @@ * */ -package com.sun.javafx.newt.awt; +package com.jogamp.newt.awt; import java.awt.event.*; -import com.sun.javafx.newt.Display; -import com.sun.javafx.newt.Window; +import com.jogamp.newt.Display; +import com.jogamp.newt.Window; import javax.media.nativewindow.*; import javax.media.nativewindow.awt.*; import java.util.*; @@ -66,20 +66,20 @@ public class AWTDisplay extends Display { } if (w != null) { switch (w.getType()) { - case com.sun.javafx.newt.WindowEvent.EVENT_WINDOW_RESIZED: - case com.sun.javafx.newt.WindowEvent.EVENT_WINDOW_MOVED: - case com.sun.javafx.newt.WindowEvent.EVENT_WINDOW_DESTROY_NOTIFY: + case com.jogamp.newt.WindowEvent.EVENT_WINDOW_RESIZED: + case com.jogamp.newt.WindowEvent.EVENT_WINDOW_MOVED: + case com.jogamp.newt.WindowEvent.EVENT_WINDOW_DESTROY_NOTIFY: w.getWindow().sendWindowEvent(w.getType()); break; - case com.sun.javafx.newt.MouseEvent.EVENT_MOUSE_CLICKED: - case com.sun.javafx.newt.MouseEvent.EVENT_MOUSE_ENTERED: - case com.sun.javafx.newt.MouseEvent.EVENT_MOUSE_EXITED: - case com.sun.javafx.newt.MouseEvent.EVENT_MOUSE_PRESSED: - case com.sun.javafx.newt.MouseEvent.EVENT_MOUSE_RELEASED: - case com.sun.javafx.newt.MouseEvent.EVENT_MOUSE_MOVED: - case com.sun.javafx.newt.MouseEvent.EVENT_MOUSE_DRAGGED: - case com.sun.javafx.newt.MouseEvent.EVENT_MOUSE_WHEEL_MOVED: + case com.jogamp.newt.MouseEvent.EVENT_MOUSE_CLICKED: + case com.jogamp.newt.MouseEvent.EVENT_MOUSE_ENTERED: + case com.jogamp.newt.MouseEvent.EVENT_MOUSE_EXITED: + case com.jogamp.newt.MouseEvent.EVENT_MOUSE_PRESSED: + case com.jogamp.newt.MouseEvent.EVENT_MOUSE_RELEASED: + case com.jogamp.newt.MouseEvent.EVENT_MOUSE_MOVED: + case com.jogamp.newt.MouseEvent.EVENT_MOUSE_DRAGGED: + case com.jogamp.newt.MouseEvent.EVENT_MOUSE_WHEEL_MOVED: { MouseEvent e = (MouseEvent) w.getEvent(); int rotation = 0; @@ -92,9 +92,9 @@ public class AWTDisplay extends Display { } break; - case com.sun.javafx.newt.KeyEvent.EVENT_KEY_PRESSED: - case com.sun.javafx.newt.KeyEvent.EVENT_KEY_RELEASED: - case com.sun.javafx.newt.KeyEvent.EVENT_KEY_TYPED: + case com.jogamp.newt.KeyEvent.EVENT_KEY_PRESSED: + case com.jogamp.newt.KeyEvent.EVENT_KEY_RELEASED: + case com.jogamp.newt.KeyEvent.EVENT_KEY_TYPED: { KeyEvent e = (KeyEvent) w.getEvent(); w.getWindow().sendKeyEvent(w.getType(), convertModifiers(e), @@ -148,19 +148,19 @@ public class AWTDisplay extends Display { private static int convertModifiers(InputEvent e) { int newtMods = 0; int mods = e.getModifiers(); - if ((mods & InputEvent.SHIFT_MASK) != 0) newtMods |= com.sun.javafx.newt.InputEvent.SHIFT_MASK; - if ((mods & InputEvent.CTRL_MASK) != 0) newtMods |= com.sun.javafx.newt.InputEvent.CTRL_MASK; - if ((mods & InputEvent.META_MASK) != 0) newtMods |= com.sun.javafx.newt.InputEvent.META_MASK; - if ((mods & InputEvent.ALT_MASK) != 0) newtMods |= com.sun.javafx.newt.InputEvent.ALT_MASK; - if ((mods & InputEvent.ALT_GRAPH_MASK) != 0) newtMods |= com.sun.javafx.newt.InputEvent.ALT_GRAPH_MASK; + if ((mods & InputEvent.SHIFT_MASK) != 0) newtMods |= com.jogamp.newt.InputEvent.SHIFT_MASK; + if ((mods & InputEvent.CTRL_MASK) != 0) newtMods |= com.jogamp.newt.InputEvent.CTRL_MASK; + if ((mods & InputEvent.META_MASK) != 0) newtMods |= com.jogamp.newt.InputEvent.META_MASK; + if ((mods & InputEvent.ALT_MASK) != 0) newtMods |= com.jogamp.newt.InputEvent.ALT_MASK; + if ((mods & InputEvent.ALT_GRAPH_MASK) != 0) newtMods |= com.jogamp.newt.InputEvent.ALT_GRAPH_MASK; return newtMods; } private static int convertButton(MouseEvent e) { switch (e.getButton()) { - case MouseEvent.BUTTON1: return com.sun.javafx.newt.MouseEvent.BUTTON1; - case MouseEvent.BUTTON2: return com.sun.javafx.newt.MouseEvent.BUTTON2; - case MouseEvent.BUTTON3: return com.sun.javafx.newt.MouseEvent.BUTTON3; + case MouseEvent.BUTTON1: return com.jogamp.newt.MouseEvent.BUTTON1; + case MouseEvent.BUTTON2: return com.jogamp.newt.MouseEvent.BUTTON2; + case MouseEvent.BUTTON3: return com.jogamp.newt.MouseEvent.BUTTON3; } return 0; } diff --git a/src/newt/classes/com/sun/javafx/newt/awt/AWTScreen.java b/src/newt/classes/com/jogamp/newt/awt/AWTScreen.java index 9bda5893b..c804bce06 100644 --- a/src/newt/classes/com/sun/javafx/newt/awt/AWTScreen.java +++ b/src/newt/classes/com/jogamp/newt/awt/AWTScreen.java @@ -31,9 +31,9 @@ * */ -package com.sun.javafx.newt.awt; +package com.jogamp.newt.awt; -import com.sun.javafx.newt.*; +import com.jogamp.newt.*; import java.awt.DisplayMode; import javax.media.nativewindow.*; import javax.media.nativewindow.awt.*; diff --git a/src/newt/classes/com/sun/javafx/newt/awt/AWTWindow.java b/src/newt/classes/com/jogamp/newt/awt/AWTWindow.java index 9725cf08b..7beeed44b 100644 --- a/src/newt/classes/com/sun/javafx/newt/awt/AWTWindow.java +++ b/src/newt/classes/com/jogamp/newt/awt/AWTWindow.java @@ -31,7 +31,7 @@ * */ -package com.sun.javafx.newt.awt; +package com.jogamp.newt.awt; import java.awt.BorderLayout; import java.awt.Canvas; @@ -47,7 +47,7 @@ import java.awt.event.*; import java.security.AccessController; import java.security.PrivilegedAction; import java.util.*; -import com.sun.javafx.newt.Window; +import com.jogamp.newt.Window; import java.awt.Insets; import javax.media.nativewindow.*; import javax.media.nativewindow.awt.*; @@ -134,18 +134,30 @@ public class AWTWindow extends Window { } } }); + this.windowHandle = 1; // just a marker .. } protected void closeNative() { - runOnEDT(true, new Runnable() { - public void run() { - if(owningFrame && null!=frame) { + this.windowHandle = 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; } - frame = null; - } - }); + }); + } } public boolean hasDeviceChanged() { @@ -204,7 +216,7 @@ public class AWTWindow extends Window { }); } - public com.sun.javafx.newt.Insets getInsets() { + public com.jogamp.newt.Insets getInsets() { final int insets[] = new int[] { 0, 0, 0, 0 }; runOnEDT(true, new Runnable() { public void run() { @@ -215,7 +227,7 @@ public class AWTWindow extends Window { insets[3] = contInsets.right; } }); - return new com.sun.javafx.newt. + return new com.jogamp.newt. Insets(insets[0],insets[1],insets[2],insets[3]); } @@ -324,7 +336,7 @@ public class AWTWindow extends Window { x = container.getX(); y = container.getY(); } - display.enqueueEvent(window, com.sun.javafx.newt.WindowEvent.EVENT_WINDOW_MOVED, null); + display.enqueueEvent(window, com.jogamp.newt.WindowEvent.EVENT_WINDOW_MOVED, null); } public void componentShown(ComponentEvent e) { @@ -347,7 +359,7 @@ public class AWTWindow extends Window { public void componentResized(ComponentEvent e) { width = canvas.getWidth(); height = canvas.getHeight(); - display.enqueueEvent(window, com.sun.javafx.newt.WindowEvent.EVENT_WINDOW_RESIZED, null); + display.enqueueEvent(window, com.jogamp.newt.WindowEvent.EVENT_WINDOW_RESIZED, null); } public void componentMoved(ComponentEvent e) { @@ -365,39 +377,39 @@ public class AWTWindow extends Window { } public void mouseEntered(MouseEvent e) { - display.enqueueEvent(window, com.sun.javafx.newt.MouseEvent.EVENT_MOUSE_ENTERED, e); + display.enqueueEvent(window, com.jogamp.newt.MouseEvent.EVENT_MOUSE_ENTERED, e); } public void mouseExited(MouseEvent e) { - display.enqueueEvent(window, com.sun.javafx.newt.MouseEvent.EVENT_MOUSE_EXITED, e); + display.enqueueEvent(window, com.jogamp.newt.MouseEvent.EVENT_MOUSE_EXITED, e); } public void mousePressed(MouseEvent e) { - display.enqueueEvent(window, com.sun.javafx.newt.MouseEvent.EVENT_MOUSE_PRESSED, e); + display.enqueueEvent(window, com.jogamp.newt.MouseEvent.EVENT_MOUSE_PRESSED, e); } public void mouseReleased(MouseEvent e) { - display.enqueueEvent(window, com.sun.javafx.newt.MouseEvent.EVENT_MOUSE_RELEASED, e); + display.enqueueEvent(window, com.jogamp.newt.MouseEvent.EVENT_MOUSE_RELEASED, e); } public void mouseMoved(MouseEvent e) { - display.enqueueEvent(window, com.sun.javafx.newt.MouseEvent.EVENT_MOUSE_MOVED, e); + display.enqueueEvent(window, com.jogamp.newt.MouseEvent.EVENT_MOUSE_MOVED, e); } public void mouseDragged(MouseEvent e) { - display.enqueueEvent(window, com.sun.javafx.newt.MouseEvent.EVENT_MOUSE_DRAGGED, e); + display.enqueueEvent(window, com.jogamp.newt.MouseEvent.EVENT_MOUSE_DRAGGED, e); } public void keyPressed(KeyEvent e) { - display.enqueueEvent(window, com.sun.javafx.newt.KeyEvent.EVENT_KEY_PRESSED, e); + display.enqueueEvent(window, com.jogamp.newt.KeyEvent.EVENT_KEY_PRESSED, e); } public void keyReleased(KeyEvent e) { - display.enqueueEvent(window, com.sun.javafx.newt.KeyEvent.EVENT_KEY_RELEASED, e); + display.enqueueEvent(window, com.jogamp.newt.KeyEvent.EVENT_KEY_RELEASED, e); } public void keyTyped(KeyEvent e) { - display.enqueueEvent(window, com.sun.javafx.newt.KeyEvent.EVENT_KEY_TYPED, e); + display.enqueueEvent(window, com.jogamp.newt.KeyEvent.EVENT_KEY_TYPED, e); } } @@ -415,7 +427,7 @@ public class AWTWindow extends Window { public void windowClosed(WindowEvent e) { } public void windowClosing(WindowEvent e) { - display.enqueueEvent(window, com.sun.javafx.newt.WindowEvent.EVENT_WINDOW_DESTROY_NOTIFY, null); + display.enqueueEvent(window, com.jogamp.newt.WindowEvent.EVENT_WINDOW_DESTROY_NOTIFY, null); } public void windowDeactivated(WindowEvent e) { } diff --git a/src/newt/classes/com/sun/javafx/newt/impl/Debug.java b/src/newt/classes/com/jogamp/newt/impl/Debug.java index 202d9d5b3..62c261d2e 100644 --- a/src/newt/classes/com/sun/javafx/newt/impl/Debug.java +++ b/src/newt/classes/com/jogamp/newt/impl/Debug.java @@ -37,7 +37,7 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.javafx.newt.impl; +package com.jogamp.newt.impl; import java.security.*; @@ -54,7 +54,7 @@ public class Debug { verbose = isPropertyDefined("newt.verbose", true); debugAll = isPropertyDefined("newt.debug", true); if (verbose) { - Package p = Package.getPackage("com.sun.javafx.newt"); + 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()); diff --git a/src/newt/classes/com/sun/javafx/newt/impl/NativeLibLoader.java b/src/newt/classes/com/jogamp/newt/impl/NEWTJNILibLoader.java index d96c56f6e..a4d234fd5 100644 --- a/src/newt/classes/com/sun/javafx/newt/impl/NativeLibLoader.java +++ b/src/newt/classes/com/jogamp/newt/impl/NEWTJNILibLoader.java @@ -37,7 +37,7 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.javafx.newt.impl; +package com.jogamp.newt.impl; // FIXME: refactor Java SE dependencies //import java.awt.Toolkit; @@ -46,9 +46,9 @@ import java.lang.reflect.Method; import java.security.AccessController; import java.security.PrivilegedAction; import java.util.HashSet; -import com.sun.nativewindow.impl.NativeLibLoaderBase; +import com.jogamp.common.jvm.JNILibLoaderBase; -public class NativeLibLoader extends NativeLibLoaderBase { +public class NEWTJNILibLoader extends JNILibLoaderBase { public static void loadNEWT() { AccessController.doPrivileged(new PrivilegedAction() { diff --git a/src/newt/classes/com/sun/javafx/newt/intel/gdl/Display.java b/src/newt/classes/com/jogamp/newt/intel/gdl/Display.java index b1f0ac6d2..a3e5501c4 100644 --- a/src/newt/classes/com/sun/javafx/newt/intel/gdl/Display.java +++ b/src/newt/classes/com/jogamp/newt/intel/gdl/Display.java @@ -31,16 +31,16 @@ * */ -package com.sun.javafx.newt.intel.gdl; +package com.jogamp.newt.intel.gdl; -import com.sun.javafx.newt.impl.*; +import com.jogamp.newt.impl.*; import javax.media.nativewindow.*; -public class Display extends com.sun.javafx.newt.Display { +public class Display extends com.jogamp.newt.Display { static int initCounter = 0; static { - NativeLibLoader.loadNEWT(); + NEWTJNILibLoader.loadNEWT(); if (!Screen.initIDs()) { throw new NativeWindowException("Failed to initialize GDL Screen jmethodIDs"); diff --git a/src/newt/classes/com/sun/javafx/newt/intel/gdl/Screen.java b/src/newt/classes/com/jogamp/newt/intel/gdl/Screen.java index 83d9074e2..873d1d009 100644 --- a/src/newt/classes/com/sun/javafx/newt/intel/gdl/Screen.java +++ b/src/newt/classes/com/jogamp/newt/intel/gdl/Screen.java @@ -31,12 +31,12 @@ * */ -package com.sun.javafx.newt.intel.gdl; +package com.jogamp.newt.intel.gdl; -import com.sun.javafx.newt.impl.*; +import com.jogamp.newt.impl.*; import javax.media.nativewindow.*; -public class Screen extends com.sun.javafx.newt.Screen { +public class Screen extends com.jogamp.newt.Screen { static { Display.initSingleton(); diff --git a/src/newt/classes/com/sun/javafx/newt/intel/gdl/Window.java b/src/newt/classes/com/jogamp/newt/intel/gdl/Window.java index 0332f442a..879fc6134 100644 --- a/src/newt/classes/com/sun/javafx/newt/intel/gdl/Window.java +++ b/src/newt/classes/com/jogamp/newt/intel/gdl/Window.java @@ -31,11 +31,11 @@ * */ -package com.sun.javafx.newt.intel.gdl; +package com.jogamp.newt.intel.gdl; import javax.media.nativewindow.*; -public class Window extends com.sun.javafx.newt.Window { +public class Window extends com.jogamp.newt.Window { static { Display.initSingleton(); } diff --git a/src/newt/classes/com/sun/javafx/newt/macosx/MacDisplay.java b/src/newt/classes/com/jogamp/newt/macosx/MacDisplay.java index cd22b2b36..0b5297685 100755 --- a/src/newt/classes/com/sun/javafx/newt/macosx/MacDisplay.java +++ b/src/newt/classes/com/jogamp/newt/macosx/MacDisplay.java @@ -31,17 +31,17 @@ * */ -package com.sun.javafx.newt.macosx; +package com.jogamp.newt.macosx; import javax.media.nativewindow.*; import javax.media.nativewindow.macosx.*; -import com.sun.javafx.newt.*; -import com.sun.javafx.newt.impl.*; -import com.sun.javafx.newt.util.MainThread; +import com.jogamp.newt.*; +import com.jogamp.newt.impl.*; +import com.jogamp.newt.util.MainThread; public class MacDisplay extends Display { static { - NativeLibLoader.loadNEWT(); + NEWTJNILibLoader.loadNEWT(); if(!initNSApplication()) { throw new NativeWindowException("Failed to initialize native Application hook"); diff --git a/src/newt/classes/com/sun/javafx/newt/macosx/MacScreen.java b/src/newt/classes/com/jogamp/newt/macosx/MacScreen.java index 8983b8803..92f8e908c 100755 --- a/src/newt/classes/com/sun/javafx/newt/macosx/MacScreen.java +++ b/src/newt/classes/com/jogamp/newt/macosx/MacScreen.java @@ -31,9 +31,9 @@ * */ -package com.sun.javafx.newt.macosx; +package com.jogamp.newt.macosx; -import com.sun.javafx.newt.*; +import com.jogamp.newt.*; import javax.media.nativewindow.*; public class MacScreen extends Screen { diff --git a/src/newt/classes/com/sun/javafx/newt/macosx/MacWindow.java b/src/newt/classes/com/jogamp/newt/macosx/MacWindow.java index 9f501ac9b..52d6fb0c7 100755 --- a/src/newt/classes/com/sun/javafx/newt/macosx/MacWindow.java +++ b/src/newt/classes/com/jogamp/newt/macosx/MacWindow.java @@ -31,13 +31,13 @@ * */ -package com.sun.javafx.newt.macosx; +package com.jogamp.newt.macosx; import javax.media.nativewindow.*; -import com.sun.javafx.newt.util.MainThread; -import com.sun.javafx.newt.*; -import com.sun.javafx.newt.impl.*; +import com.jogamp.newt.util.MainThread; +import com.jogamp.newt.*; +import com.jogamp.newt.impl.*; public class MacWindow extends Window { @@ -212,42 +212,16 @@ public class MacWindow extends Window { } } - private ToolkitLock nsViewLock = new ToolkitLock() { - private Thread owner; - private int recursionCount; - - public synchronized void lock() { - Thread cur = Thread.currentThread(); - if (owner == cur) { - ++recursionCount; - return; - } - while (owner != null) { - try { - wait(); - } catch (InterruptedException e) { - throw new RuntimeException(e); - } - } - owner = cur; - } - - public synchronized void unlock() { - if (owner != Thread.currentThread()) { - throw new RuntimeException("Not owner"); - } - if (recursionCount > 0) { - --recursionCount; - return; - } - owner = null; - notifyAll(); - } - }; + private WindowToolkitLock nsViewLock = new WindowToolkitLock(); public synchronized int lockSurface() throws NativeWindowException { nsViewLock.lock(); - return super.lockSurface(); + try { + return super.lockSurface(); + } catch (RuntimeException re) { + nsViewLock.unlock(); + throw re; + } } public void unlockSurface() { diff --git a/src/newt/classes/com/sun/javafx/newt/opengl/GLWindow.java b/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java index e809d2cdc..fec70c99c 100644 --- a/src/newt/classes/com/sun/javafx/newt/opengl/GLWindow.java +++ b/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java @@ -31,12 +31,12 @@ * */ -package com.sun.javafx.newt.opengl; +package com.jogamp.newt.opengl; -import com.sun.javafx.newt.*; +import com.jogamp.newt.*; import javax.media.nativewindow.*; import javax.media.opengl.*; -import com.sun.opengl.impl.GLDrawableHelper; +import com.jogamp.opengl.impl.GLDrawableHelper; import java.util.*; /** @@ -58,13 +58,14 @@ public class GLWindow extends Window implements GLAutoDrawable { private Window window; private boolean runPumpMessages; - /** Constructor. Do not call this directly -- use {@link - create()} instead. */ + /** + * Constructor. Do not call this directly -- use {@link #create()} instead. + */ protected GLWindow(Window window, boolean ownerOfWinScrDpy) { this.ownerOfWinScrDpy = ownerOfWinScrDpy; this.window = window; this.window.setAutoDrawableClient(true); - this.runPumpMessages = ( null == getScreen().getDisplay().getEDT() ) ; + this.runPumpMessages = ( null == getScreen().getDisplay().getEDTUtil() ) ; window.addWindowListener(new WindowListener() { public void windowResized(WindowEvent e) { sendReshape = true; @@ -145,13 +146,13 @@ public class GLWindow extends Window implements GLAutoDrawable { * Best performance has been achieved with one GLWindow per thread.<br> * * Enabling local pump messages while using the EDT, - * {@link com.sun.javafx.newt.NewtFactory#setUseEDT(boolean)}, + * {@link com.jogamp.newt.NewtFactory#setUseEDT(boolean)}, * will result in an exception. * * @deprecated EXPERIMENTAL, semantic is about to be removed after further verification. */ public void setRunPumpMessages(boolean onoff) { - if( onoff && null!=getScreen().getDisplay().getEDT() ) { + if( onoff && null!=getScreen().getDisplay().getEDTUtil() ) { throw new GLException("GLWindow.setRunPumpMessages(true) - Can't do with EDT on"); } runPumpMessages = onoff; @@ -334,6 +335,9 @@ public class GLWindow extends Window implements GLAutoDrawable { public void removeSurfaceUpdatedListener(SurfaceUpdatedListener l) { window.removeSurfaceUpdatedListener(l); } + public void removeAllSurfaceUpdatedListener() { + window.removeAllSurfaceUpdatedListener(); + } public SurfaceUpdatedListener[] getSurfaceUpdatedListener() { return window.getSurfaceUpdatedListener(); } @@ -378,7 +382,7 @@ public class GLWindow extends Window implements GLAutoDrawable { } public String toString() { - return "NEWT-GLWindow[ \n\tDrawable: "+drawable+", \n\tWindow: "+window+", \n\tHelper: "+helper+", \n\tFactory: "+factory+"]"; + return "NEWT-GLWindow[ \n\tHelper: "+helper+", \n\tDrawable: "+drawable + /** ", \n\tWindow: "+window+", \n\tFactory: "+factory+ */ "]"; } //---------------------------------------------------------------------- diff --git a/src/newt/classes/com/sun/javafx/newt/opengl/broadcom/egl/Display.java b/src/newt/classes/com/jogamp/newt/opengl/broadcom/egl/Display.java index debe9e9b9..999a407ec 100644 --- a/src/newt/classes/com/sun/javafx/newt/opengl/broadcom/egl/Display.java +++ b/src/newt/classes/com/jogamp/newt/opengl/broadcom/egl/Display.java @@ -31,17 +31,17 @@ * */ -package com.sun.javafx.newt.opengl.broadcom.egl; +package com.jogamp.newt.opengl.broadcom.egl; -import com.sun.javafx.newt.impl.*; -import com.sun.opengl.impl.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.sun.javafx.newt.Display { +public class Display extends com.jogamp.newt.Display { static { - NativeLibLoader.loadNEWT(); + NEWTJNILibLoader.loadNEWT(); if (!Window.initIDs()) { throw new NativeWindowException("Failed to initialize BCEGL Window jmethodIDs"); diff --git a/src/newt/classes/com/sun/javafx/newt/opengl/broadcom/egl/Screen.java b/src/newt/classes/com/jogamp/newt/opengl/broadcom/egl/Screen.java index 28f7211c3..b4f07599b 100755 --- a/src/newt/classes/com/sun/javafx/newt/opengl/broadcom/egl/Screen.java +++ b/src/newt/classes/com/jogamp/newt/opengl/broadcom/egl/Screen.java @@ -31,12 +31,11 @@ * */ -package com.sun.javafx.newt.opengl.broadcom.egl; +package com.jogamp.newt.opengl.broadcom.egl; -import com.sun.javafx.newt.impl.*; import javax.media.nativewindow.*; -public class Screen extends com.sun.javafx.newt.Screen { +public class Screen extends com.jogamp.newt.Screen { static { Display.initSingleton(); diff --git a/src/newt/classes/com/sun/javafx/newt/opengl/broadcom/egl/Window.java b/src/newt/classes/com/jogamp/newt/opengl/broadcom/egl/Window.java index 11672dde3..185dc97b9 100755 --- a/src/newt/classes/com/sun/javafx/newt/opengl/broadcom/egl/Window.java +++ b/src/newt/classes/com/jogamp/newt/opengl/broadcom/egl/Window.java @@ -31,16 +31,14 @@ * */ -package com.sun.javafx.newt.opengl.broadcom.egl; +package com.jogamp.newt.opengl.broadcom.egl; -import com.sun.javafx.newt.impl.*; -import com.sun.opengl.impl.egl.*; +import com.jogamp.opengl.impl.egl.*; import javax.media.nativewindow.*; import javax.media.opengl.GLCapabilities; -import javax.media.opengl.GLProfile; import javax.media.nativewindow.NativeWindowException; -public class Window extends com.sun.javafx.newt.Window { +public class Window extends com.jogamp.newt.Window { static { Display.initSingleton(); } diff --git a/src/newt/classes/com/sun/javafx/newt/opengl/kd/KDDisplay.java b/src/newt/classes/com/jogamp/newt/opengl/kd/KDDisplay.java index 5aeae75ea..6a28f992b 100755 --- a/src/newt/classes/com/sun/javafx/newt/opengl/kd/KDDisplay.java +++ b/src/newt/classes/com/jogamp/newt/opengl/kd/KDDisplay.java @@ -31,18 +31,18 @@ * */ -package com.sun.javafx.newt.opengl.kd; +package com.jogamp.newt.opengl.kd; -import com.sun.javafx.newt.*; -import com.sun.javafx.newt.impl.*; -import com.sun.opengl.impl.egl.*; +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 Display { static { - NativeLibLoader.loadNEWT(); + NEWTJNILibLoader.loadNEWT(); if (!KDWindow.initIDs()) { throw new NativeWindowException("Failed to initialize KDWindow jmethodIDs"); diff --git a/src/newt/classes/com/sun/javafx/newt/opengl/kd/KDScreen.java b/src/newt/classes/com/jogamp/newt/opengl/kd/KDScreen.java index 1767c1240..cd53c8152 100755 --- a/src/newt/classes/com/sun/javafx/newt/opengl/kd/KDScreen.java +++ b/src/newt/classes/com/jogamp/newt/opengl/kd/KDScreen.java @@ -31,9 +31,9 @@ * */ -package com.sun.javafx.newt.opengl.kd; +package com.jogamp.newt.opengl.kd; -import com.sun.javafx.newt.*; +import com.jogamp.newt.*; import javax.media.nativewindow.*; public class KDScreen extends Screen { diff --git a/src/newt/classes/com/sun/javafx/newt/opengl/kd/KDWindow.java b/src/newt/classes/com/jogamp/newt/opengl/kd/KDWindow.java index 605e9c064..555f54599 100755 --- a/src/newt/classes/com/sun/javafx/newt/opengl/kd/KDWindow.java +++ b/src/newt/classes/com/jogamp/newt/opengl/kd/KDWindow.java @@ -31,11 +31,11 @@ * */ -package com.sun.javafx.newt.opengl.kd; +package com.jogamp.newt.opengl.kd; -import com.sun.javafx.newt.*; -import com.sun.javafx.newt.impl.*; -import com.sun.opengl.impl.egl.*; +import com.jogamp.newt.*; +import com.jogamp.newt.impl.*; +import com.jogamp.opengl.impl.egl.*; import javax.media.nativewindow.*; import javax.media.opengl.GLCapabilities; import javax.media.opengl.GLProfile; diff --git a/src/newt/classes/com/sun/javafx/newt/util/EventDispatchThread.java b/src/newt/classes/com/jogamp/newt/util/EDTUtil.java index a98ebab93..f852bcf5c 100644 --- a/src/newt/classes/com/sun/javafx/newt/util/EventDispatchThread.java +++ b/src/newt/classes/com/jogamp/newt/util/EDTUtil.java @@ -34,36 +34,36 @@ * facility. */ -package com.sun.javafx.newt.util; +package com.jogamp.newt.util; -import com.sun.javafx.newt.Display; -import com.sun.javafx.newt.impl.Debug; +import com.jogamp.newt.Display; +import com.jogamp.newt.impl.Debug; import java.util.*; -public class EventDispatchThread { +public class EDTUtil { public static final boolean DEBUG = Debug.debug("EDT"); private ThreadGroup threadGroup; private volatile boolean shouldStop = false; - private TaskWorker taskWorker = null; - private Object taskWorkerLock = new Object(); + private EventDispatchThread edt = null; + private Object edtLock = new Object(); private ArrayList tasks = new ArrayList(); // one shot tasks - private Display display = null; private String name; - private long edtPollGranularity = 10; + private Runnable pumpMessages; + private long edtPollGranularity = 10; // 10ms, 1/100s - public EventDispatchThread(Display display, ThreadGroup tg, String name) { - this.display = display; + public EDTUtil(ThreadGroup tg, String name, Runnable pumpMessages) { this.threadGroup = tg; - this.name=new String("EDT-Display_"+display.getName()+"-"+name); + this.name=new String("EDT-"+name); + this.pumpMessages=pumpMessages; } public String getName() { return name; } public ThreadGroup getThreadGroup() { return threadGroup; } - public void start() { - start(false); + public Thread start() { + return start(false); } /** @@ -75,52 +75,56 @@ public class EventDispatchThread { * Usefull in combination with externalStimuli=true, * so an external stimuli can call it. */ - public Runnable start(boolean externalStimuli) { - synchronized(taskWorkerLock) { - if(null==taskWorker) { - taskWorker = new TaskWorker(threadGroup, name); + public Thread start(boolean externalStimuli) { + synchronized(edtLock) { + if(null==edt) { + edt = new EventDispatchThread(threadGroup, name); } - if(!taskWorker.isRunning()) { + if(!edt.isRunning()) { shouldStop = false; - taskWorker.start(externalStimuli); + edt.start(externalStimuli); } - taskWorkerLock.notifyAll(); + edtLock.notifyAll(); } - return taskWorker; + return edt; } public void stop() { - synchronized(taskWorkerLock) { - if(null!=taskWorker && taskWorker.isRunning()) { + synchronized(edtLock) { + if(null!=edt && edt.isRunning()) { shouldStop = true; } - taskWorkerLock.notifyAll(); + edtLock.notifyAll(); if(DEBUG) { System.out.println(Thread.currentThread()+": EDT signal STOP"); } } } + public Thread getEDT() { + return edt; + } + public boolean isThreadEDT(Thread thread) { - return null!=taskWorker && taskWorker == thread; + return null!=edt && edt == thread; } public boolean isCurrentThreadEDT() { - return null!=taskWorker && taskWorker == Thread.currentThread(); + return null!=edt && edt == Thread.currentThread(); } public boolean isRunning() { - return null!=taskWorker && taskWorker.isRunning() ; + return null!=edt && edt.isRunning() ; } public void invokeLater(Runnable task) { if(task == null) { return; } - synchronized(taskWorkerLock) { - if(null!=taskWorker && taskWorker.isRunning() && taskWorker != Thread.currentThread() ) { + synchronized(edtLock) { + if(null!=edt && edt.isRunning() && edt != Thread.currentThread() ) { tasks.add(task); - taskWorkerLock.notifyAll(); + edtLock.notifyAll(); } else { // if !running or isEDTThread, do it right away task.run(); @@ -137,10 +141,10 @@ public class EventDispatchThread { } public void waitOnWorker() { - synchronized(taskWorkerLock) { - if(null!=taskWorker && taskWorker.isRunning() && tasks.size()>0 && taskWorker != Thread.currentThread() ) { + synchronized(edtLock) { + if(null!=edt && edt.isRunning() && tasks.size()>0 && edt != Thread.currentThread() ) { try { - taskWorkerLock.wait(); + edtLock.wait(); } catch (InterruptedException e) { e.printStackTrace(); } @@ -149,10 +153,10 @@ public class EventDispatchThread { } public void waitUntilStopped() { - synchronized(taskWorkerLock) { - while(null!=taskWorker && taskWorker.isRunning() && taskWorker != Thread.currentThread() ) { + synchronized(edtLock) { + while(null!=edt && edt.isRunning() && edt != Thread.currentThread() ) { try { - taskWorkerLock.wait(); + edtLock.wait(); } catch (InterruptedException e) { e.printStackTrace(); } @@ -160,11 +164,11 @@ public class EventDispatchThread { } } - class TaskWorker extends Thread { + class EventDispatchThread extends Thread { boolean isRunning = false; boolean externalStimuli = false; - public TaskWorker(ThreadGroup tg, String name) { + public EventDispatchThread(ThreadGroup tg, String name) { super(tg, name); } @@ -183,7 +187,7 @@ public class EventDispatchThread { } /** - * Utilizing taskWorkerLock only for local resources and task execution, + * Utilizing edtLock only for local resources and task execution, * not for event dispatching. */ public void run() { @@ -194,26 +198,26 @@ public class EventDispatchThread { try { // wait for something todo while(!shouldStop && tasks.size()==0) { - synchronized(taskWorkerLock) { + synchronized(edtLock) { if(!shouldStop && tasks.size()==0) { try { - taskWorkerLock.wait(edtPollGranularity); + edtLock.wait(edtPollGranularity); } catch (InterruptedException e) { e.printStackTrace(); } } } - display.pumpMessages(); // event dispatch + pumpMessages.run(); // event dispatch } if(!shouldStop && tasks.size()>0) { - synchronized(taskWorkerLock) { + synchronized(edtLock) { if(!shouldStop && tasks.size()>0) { Runnable task = (Runnable) tasks.remove(0); task.run(); - taskWorkerLock.notifyAll(); + edtLock.notifyAll(); } } - display.pumpMessages(); // event dispatch + pumpMessages.run(); // event dispatch } } catch (Throwable t) { // handle errors .. @@ -227,8 +231,8 @@ public class EventDispatchThread { isRunning = !shouldStop; } if(!isRunning) { - synchronized(taskWorkerLock) { - taskWorkerLock.notifyAll(); + synchronized(edtLock) { + edtLock.notifyAll(); } } if(DEBUG) { diff --git a/src/newt/classes/com/sun/javafx/newt/util/MainThread.java b/src/newt/classes/com/jogamp/newt/util/MainThread.java index abfe3f0c7..daa09edce 100644 --- a/src/newt/classes/com/sun/javafx/newt/util/MainThread.java +++ b/src/newt/classes/com/jogamp/newt/util/MainThread.java @@ -34,7 +34,7 @@ * facility. */ -package com.sun.javafx.newt.util; +package com.jogamp.newt.util; import java.util.*; import java.lang.reflect.Method; @@ -43,10 +43,10 @@ import java.security.*; import javax.media.nativewindow.*; -import com.sun.javafx.newt.*; -import com.sun.javafx.newt.impl.*; -import com.sun.javafx.newt.macosx.MacDisplay; -import com.sun.nativewindow.impl.NWReflection; +import com.jogamp.common.util.*; +import com.jogamp.newt.*; +import com.jogamp.newt.impl.*; +import com.jogamp.newt.macosx.MacDisplay; /** * NEWT Utility class MainThread<P> @@ -64,7 +64,7 @@ import com.sun.nativewindow.impl.NWReflection; * * To support your NEWT Window platform, * you have to pass your <i>main thread</i> actions to {@link #invoke invoke(..)}, - * have a look at the {@link com.sun.javafx.newt.macosx.MacWindow MacWindow} implementation.<br> + * have a look at the {@link com.jogamp.newt.macosx.MacWindow MacWindow} implementation.<br> * <i>TODO</i>: Some hardcoded dependencies exist in this implementation, * where you have to patch this code or factor it out. <P> * @@ -77,7 +77,7 @@ import com.sun.nativewindow.impl.NWReflection; * * Test case on Mac OS X (or any other platform): <PRE> - java -XstartOnFirstThread com.sun.javafx.newt.util.MainThread demos.es1.RedSquare -GL2 -GL2 -GL2 -GL2 + java -XstartOnFirstThread com.jogamp.newt.util.MainThread demos.es1.RedSquare -GL2 -GL2 -GL2 -GL2 </PRE> * Which starts 4 threads, each with a window and OpenGL rendering.<br> */ @@ -116,7 +116,7 @@ public class MainThread { // start user app .. try { - Class mainClass = NWReflection.getClass(mainClassName, true); + Class mainClass = ReflectionUtil.getClass(mainClassName, true); if(null==mainClass) { throw new RuntimeException(new ClassNotFoundException("MainThread couldn't find main class "+mainClassName)); } @@ -159,7 +159,7 @@ public class MainThread { System.arraycopy(args, 1, mainClassArgs, 0, args.length-1); } - NativeLibLoader.loadNEWT(); + NEWTJNILibLoader.loadNEWT(); shouldStop = false; tasks = new ArrayList(); diff --git a/src/newt/classes/com/sun/javafx/newt/windows/WindowsDisplay.java b/src/newt/classes/com/jogamp/newt/windows/WindowsDisplay.java index 80485ed67..281022901 100755 --- a/src/newt/classes/com/sun/javafx/newt/windows/WindowsDisplay.java +++ b/src/newt/classes/com/jogamp/newt/windows/WindowsDisplay.java @@ -31,12 +31,12 @@ * */ -package com.sun.javafx.newt.windows; +package com.jogamp.newt.windows; import javax.media.nativewindow.*; import javax.media.nativewindow.windows.*; -import com.sun.javafx.newt.*; -import com.sun.javafx.newt.impl.*; +import com.jogamp.newt.*; +import com.jogamp.newt.impl.*; public class WindowsDisplay extends Display { @@ -45,7 +45,7 @@ public class WindowsDisplay extends Display { private static long hInstance; static { - NativeLibLoader.loadNEWT(); + NEWTJNILibLoader.loadNEWT(); if (!WindowsWindow.initIDs()) { throw new NativeWindowException("Failed to initialize WindowsWindow jmethodIDs"); diff --git a/src/newt/classes/com/sun/javafx/newt/windows/WindowsScreen.java b/src/newt/classes/com/jogamp/newt/windows/WindowsScreen.java index 87ae1b49d..aea3cd439 100755 --- a/src/newt/classes/com/sun/javafx/newt/windows/WindowsScreen.java +++ b/src/newt/classes/com/jogamp/newt/windows/WindowsScreen.java @@ -31,10 +31,9 @@ * */ -package com.sun.javafx.newt.windows; +package com.jogamp.newt.windows; -import com.sun.javafx.newt.*; -import com.sun.javafx.newt.impl.*; +import com.jogamp.newt.*; import javax.media.nativewindow.*; public class WindowsScreen extends Screen { diff --git a/src/newt/classes/com/sun/javafx/newt/windows/WindowsWindow.java b/src/newt/classes/com/jogamp/newt/windows/WindowsWindow.java index 1b5bf80cf..4a468ae86 100755 --- a/src/newt/classes/com/sun/javafx/newt/windows/WindowsWindow.java +++ b/src/newt/classes/com/jogamp/newt/windows/WindowsWindow.java @@ -31,10 +31,10 @@ * */ -package com.sun.javafx.newt.windows; +package com.jogamp.newt.windows; import javax.media.nativewindow.*; -import com.sun.javafx.newt.*; +import com.jogamp.newt.*; public class WindowsWindow extends Window { diff --git a/src/newt/classes/com/sun/javafx/newt/x11/X11Display.java b/src/newt/classes/com/jogamp/newt/x11/X11Display.java index ae23c4423..c8faefbf1 100755 --- a/src/newt/classes/com/sun/javafx/newt/x11/X11Display.java +++ b/src/newt/classes/com/jogamp/newt/x11/X11Display.java @@ -31,17 +31,17 @@ * */ -package com.sun.javafx.newt.x11; +package com.jogamp.newt.x11; import javax.media.nativewindow.*; import javax.media.nativewindow.x11.*; -import com.sun.javafx.newt.*; -import com.sun.javafx.newt.impl.*; -import com.sun.nativewindow.impl.x11.X11Util; +import com.jogamp.newt.*; +import com.jogamp.newt.impl.*; +import com.jogamp.nativewindow.impl.x11.X11Util; public class X11Display extends Display { static { - NativeLibLoader.loadNEWT(); + NEWTJNILibLoader.loadNEWT(); if (!initIDs()) { throw new NativeWindowException("Failed to initialize X11Display jmethodIDs"); @@ -61,7 +61,7 @@ public class X11Display extends Display { } protected void createNative() { - long handle= X11Util.getThreadLocalDisplay(name); + long handle= X11Util.createThreadLocalDisplay(name); if (handle == 0 ) { throw new RuntimeException("Error creating display: "+name); } @@ -75,9 +75,7 @@ public class X11Display extends Display { } protected void closeNative() { - if(0==X11Util.closeThreadLocalDisplay(name)) { - throw new NativeWindowException(this+" was not mapped"); - } + X11Util.closeThreadLocalDisplay(name); } protected void dispatchMessages() { diff --git a/src/newt/classes/com/sun/javafx/newt/x11/X11Screen.java b/src/newt/classes/com/jogamp/newt/x11/X11Screen.java index cee576e2c..e053d99c0 100755 --- a/src/newt/classes/com/sun/javafx/newt/x11/X11Screen.java +++ b/src/newt/classes/com/jogamp/newt/x11/X11Screen.java @@ -31,11 +31,9 @@ * */ -package com.sun.javafx.newt.x11; +package com.jogamp.newt.x11; -import com.sun.javafx.newt.*; -import com.sun.javafx.newt.impl.*; -import javax.media.nativewindow.*; +import com.jogamp.newt.*; import javax.media.nativewindow.x11.*; public class X11Screen extends Screen { diff --git a/src/newt/classes/com/sun/javafx/newt/x11/X11Window.java b/src/newt/classes/com/jogamp/newt/x11/X11Window.java index f46ae9564..cc3aa58a2 100755 --- a/src/newt/classes/com/sun/javafx/newt/x11/X11Window.java +++ b/src/newt/classes/com/jogamp/newt/x11/X11Window.java @@ -31,10 +31,9 @@ * */ -package com.sun.javafx.newt.x11; +package com.jogamp.newt.x11; -import com.sun.javafx.newt.*; -import com.sun.javafx.newt.impl.*; +import com.jogamp.newt.*; import javax.media.nativewindow.*; import javax.media.nativewindow.x11.*; diff --git a/src/newt/native/BroadcomEGL.c b/src/newt/native/BroadcomEGL.c index 55688f9d1..9aac90abb 100755 --- a/src/newt/native/BroadcomEGL.c +++ b/src/newt/native/BroadcomEGL.c @@ -41,7 +41,7 @@ #include <stdio.h> #include <string.h> -#include "com_sun_javafx_newt_opengl_broadcom_egl_Window.h" +#include "com_jogamp_newt_opengl_broadcom_egl_Window.h" #include "EventListener.h" #include "MouseEvent.h" @@ -72,7 +72,7 @@ static jmethodID windowCreatedID = NULL; * Display */ -JNIEXPORT void JNICALL Java_com_sun_javafx_newt_opengl_broadcom_egl_Display_DispatchMessages +JNIEXPORT void JNICALL Java_com_jogamp_newt_opengl_broadcom_egl_Display_DispatchMessages (JNIEnv *env, jobject obj) { // FIXME: n/a @@ -80,7 +80,7 @@ JNIEXPORT void JNICALL Java_com_sun_javafx_newt_opengl_broadcom_egl_Display_Disp (void) obj; } -JNIEXPORT jlong JNICALL Java_com_sun_javafx_newt_opengl_broadcom_egl_Display_CreateDisplay +JNIEXPORT jlong JNICALL Java_com_jogamp_newt_opengl_broadcom_egl_Display_CreateDisplay (JNIEnv *env, jobject obj, jint width, jint height) { (void) env; @@ -94,7 +94,7 @@ JNIEXPORT jlong JNICALL Java_com_sun_javafx_newt_opengl_broadcom_egl_Display_Cre return (jlong) (intptr_t) dpy; } -JNIEXPORT void JNICALL Java_com_sun_javafx_newt_opengl_broadcom_egl_Display_DestroyDisplay +JNIEXPORT void JNICALL Java_com_jogamp_newt_opengl_broadcom_egl_Display_DestroyDisplay (JNIEnv *env, jobject obj, jlong display) { EGLDisplay dpy = (EGLDisplay)(intptr_t)display; @@ -111,7 +111,7 @@ JNIEXPORT void JNICALL Java_com_sun_javafx_newt_opengl_broadcom_egl_Display_Dest * Window */ -JNIEXPORT jboolean JNICALL Java_com_sun_javafx_newt_opengl_broadcom_egl_Window_initIDs +JNIEXPORT jboolean JNICALL Java_com_jogamp_newt_opengl_broadcom_egl_Window_initIDs (JNIEnv *env, jclass clazz) { windowCreatedID = (*env)->GetMethodID(env, clazz, "windowCreated", "(III)V"); @@ -123,7 +123,7 @@ JNIEXPORT jboolean JNICALL Java_com_sun_javafx_newt_opengl_broadcom_egl_Window_i return JNI_TRUE; } -JNIEXPORT jlong JNICALL Java_com_sun_javafx_newt_opengl_broadcom_egl_Window_CreateWindow +JNIEXPORT jlong JNICALL Java_com_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; @@ -167,7 +167,7 @@ JNIEXPORT jlong JNICALL Java_com_sun_javafx_newt_opengl_broadcom_egl_Window_Crea return (jlong) (intptr_t) window; } -JNIEXPORT void JNICALL Java_com_sun_javafx_newt_opengl_broadcom_egl_Window_CloseWindow +JNIEXPORT void JNICALL Java_com_jogamp_newt_opengl_broadcom_egl_Window_CloseWindow (JNIEnv *env, jobject obj, jlong display, jlong window) { EGLDisplay dpy = (EGLDisplay) (intptr_t) display; @@ -180,7 +180,7 @@ JNIEXPORT void JNICALL Java_com_sun_javafx_newt_opengl_broadcom_egl_Window_Close DBG_PRINT( "[CloseWindow] X\n"); } -JNIEXPORT void JNICALL Java_com_sun_javafx_newt_opengl_broadcom_egl_Window_SwapWindow +JNIEXPORT void JNICALL Java_com_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 1bc43cd0e..7857b594f 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_sun_javafx_newt_intel_gdl_Display.h" -#include "com_sun_javafx_newt_intel_gdl_Screen.h" -#include "com_sun_javafx_newt_intel_gdl_Window.h" +#include "com_jogamp_newt_intel_gdl_Display.h" +#include "com_jogamp_newt_intel_gdl_Screen.h" +#include "com_jogamp_newt_intel_gdl_Window.h" #include "EventListener.h" #include "MouseEvent.h" @@ -123,7 +123,7 @@ static void JNI_ThrowNew(JNIEnv *env, const char *throwable, const char* message * Display */ -JNIEXPORT void JNICALL Java_com_sun_javafx_newt_intel_gdl_Display_DispatchMessages +JNIEXPORT void JNICALL Java_com_jogamp_newt_intel_gdl_Display_DispatchMessages (JNIEnv *env, jobject obj, jlong displayHandle, jobject focusedWindow) { // FIXME: n/a @@ -138,7 +138,7 @@ JNIEXPORT void JNICALL Java_com_sun_javafx_newt_intel_gdl_Display_DispatchMessag } */ } -JNIEXPORT jlong JNICALL Java_com_sun_javafx_newt_intel_gdl_Display_CreateDisplay +JNIEXPORT jlong JNICALL Java_com_jogamp_newt_intel_gdl_Display_CreateDisplay (JNIEnv *env, jobject obj) { gdl_ret_t retval; @@ -171,7 +171,7 @@ JNIEXPORT jlong JNICALL Java_com_sun_javafx_newt_intel_gdl_Display_CreateDisplay return (jlong) (intptr_t) p_driver_info; } -JNIEXPORT void JNICALL Java_com_sun_javafx_newt_intel_gdl_Display_DestroyDisplay +JNIEXPORT void JNICALL Java_com_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; @@ -190,7 +190,7 @@ JNIEXPORT void JNICALL Java_com_sun_javafx_newt_intel_gdl_Display_DestroyDisplay * Screen */ -JNIEXPORT jboolean JNICALL Java_com_sun_javafx_newt_intel_gdl_Screen_initIDs +JNIEXPORT jboolean JNICALL Java_com_jogamp_newt_intel_gdl_Screen_initIDs (JNIEnv *env, jclass clazz) { screenCreatedID = (*env)->GetMethodID(env, clazz, "screenCreated", "(II)V"); @@ -202,7 +202,7 @@ JNIEXPORT jboolean JNICALL Java_com_sun_javafx_newt_intel_gdl_Screen_initIDs return JNI_TRUE; } -JNIEXPORT void JNICALL Java_com_sun_javafx_newt_intel_gdl_Screen_GetScreenInfo +JNIEXPORT void JNICALL Java_com_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; @@ -234,7 +234,7 @@ JNIEXPORT void JNICALL Java_com_sun_javafx_newt_intel_gdl_Screen_GetScreenInfo * Window */ -JNIEXPORT jboolean JNICALL Java_com_sun_javafx_newt_intel_gdl_Window_initIDs +JNIEXPORT jboolean JNICALL Java_com_jogamp_newt_intel_gdl_Window_initIDs (JNIEnv *env, jclass clazz) { updateBoundsID = (*env)->GetMethodID(env, clazz, "updateBounds", "(IIII)V"); @@ -246,7 +246,7 @@ JNIEXPORT jboolean JNICALL Java_com_sun_javafx_newt_intel_gdl_Window_initIDs return JNI_TRUE; } -JNIEXPORT jlong JNICALL Java_com_sun_javafx_newt_intel_gdl_Window_CreateSurface +JNIEXPORT jlong JNICALL Java_com_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; @@ -339,7 +339,7 @@ JNIEXPORT jlong JNICALL Java_com_sun_javafx_newt_intel_gdl_Window_CreateSurface return (jlong) (intptr_t) plane; } -JNIEXPORT void JNICALL Java_com_sun_javafx_newt_intel_gdl_Window_CloseSurface +JNIEXPORT void JNICALL Java_com_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 ; @@ -348,7 +348,7 @@ JNIEXPORT void JNICALL Java_com_sun_javafx_newt_intel_gdl_Window_CloseSurface DBG_PRINT("[CloseSurface] plane %d\n", plane); } -JNIEXPORT void JNICALL Java_com_sun_javafx_newt_intel_gdl_Window_SetBounds0 +JNIEXPORT void JNICALL Java_com_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 6c7aa7731..15bef7582 100755 --- a/src/newt/native/KDWindow.c +++ b/src/newt/native/KDWindow.c @@ -64,7 +64,7 @@ #include <KD/kd.h> #include <KD/NV_extwindowprops.h> -#include "com_sun_javafx_newt_opengl_kd_KDWindow.h" +#include "com_jogamp_newt_opengl_kd_KDWindow.h" #include "EventListener.h" #include "MouseEvent.h" @@ -103,7 +103,7 @@ static jmethodID sendKeyEventID = NULL; * Display */ -JNIEXPORT void JNICALL Java_com_sun_javafx_newt_opengl_kd_KDDisplay_DispatchMessages +JNIEXPORT void JNICALL Java_com_jogamp_newt_opengl_kd_KDDisplay_DispatchMessages (JNIEnv *env, jobject obj) { const KDEvent * evt; @@ -200,7 +200,7 @@ JNIEXPORT void JNICALL Java_com_sun_javafx_newt_opengl_kd_KDDisplay_DispatchMess * Window */ -JNIEXPORT jboolean JNICALL Java_com_sun_javafx_newt_opengl_kd_KDWindow_initIDs +JNIEXPORT jboolean JNICALL Java_com_jogamp_newt_opengl_kd_KDWindow_initIDs (JNIEnv *env, jclass clazz) { #ifdef VERBOSE_ON @@ -228,7 +228,7 @@ JNIEXPORT jboolean JNICALL Java_com_sun_javafx_newt_opengl_kd_KDWindow_initIDs return JNI_TRUE; } -JNIEXPORT jlong JNICALL Java_com_sun_javafx_newt_opengl_kd_KDWindow_CreateWindow +JNIEXPORT jlong JNICALL Java_com_jogamp_newt_opengl_kd_KDWindow_CreateWindow (JNIEnv *env, jobject obj, jlong display, jintArray jAttrs) { jint * attrs = NULL; @@ -270,7 +270,7 @@ JNIEXPORT jlong JNICALL Java_com_sun_javafx_newt_opengl_kd_KDWindow_CreateWindow return (jlong) (intptr_t) window; } -JNIEXPORT jlong JNICALL Java_com_sun_javafx_newt_opengl_kd_KDWindow_RealizeWindow +JNIEXPORT jlong JNICALL Java_com_jogamp_newt_opengl_kd_KDWindow_RealizeWindow (JNIEnv *env, jobject obj, jlong window) { KDWindow *w = (KDWindow*) (intptr_t) window; @@ -285,7 +285,7 @@ JNIEXPORT jlong JNICALL Java_com_sun_javafx_newt_opengl_kd_KDWindow_RealizeWindo return (jlong) (intptr_t) nativeWindow; } -JNIEXPORT jint JNICALL Java_com_sun_javafx_newt_opengl_kd_KDWindow_CloseWindow +JNIEXPORT jint JNICALL Java_com_jogamp_newt_opengl_kd_KDWindow_CloseWindow (JNIEnv *env, jobject obj, jlong window, jlong juserData) { KDWindow *w = (KDWindow*) (intptr_t) window; @@ -299,11 +299,11 @@ JNIEXPORT jint JNICALL Java_com_sun_javafx_newt_opengl_kd_KDWindow_CloseWindow } /* - * Class: com_sun_javafx_newt_opengl_kd_KDWindow + * Class: com_jogamp_newt_opengl_kd_KDWindow * Method: setVisible0 * Signature: (JJZ)V */ -JNIEXPORT void JNICALL Java_com_sun_javafx_newt_opengl_kd_KDWindow_setVisible0 +JNIEXPORT void JNICALL Java_com_jogamp_newt_opengl_kd_KDWindow_setVisible0 (JNIEnv *env, jobject obj, jlong window, jboolean visible) { KDWindow *w = (KDWindow*) (intptr_t) window; @@ -312,7 +312,7 @@ JNIEXPORT void JNICALL Java_com_sun_javafx_newt_opengl_kd_KDWindow_setVisible0 DBG_PRINT( "[setVisible] v=%d\n", visible); } -JNIEXPORT void JNICALL Java_com_sun_javafx_newt_opengl_kd_KDWindow_setFullScreen0 +JNIEXPORT void JNICALL Java_com_jogamp_newt_opengl_kd_KDWindow_setFullScreen0 (JNIEnv *env, jobject obj, jlong window, jboolean fullscreen) { KDWindow *w = (KDWindow*) (intptr_t) window; @@ -323,7 +323,7 @@ JNIEXPORT void JNICALL Java_com_sun_javafx_newt_opengl_kd_KDWindow_setFullScreen (void)res; } -JNIEXPORT void JNICALL Java_com_sun_javafx_newt_opengl_kd_KDWindow_setSize0 +JNIEXPORT void JNICALL Java_com_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 1749805c8..f0ebfc0a0 100644 --- a/src/newt/native/MacWindow.m +++ b/src/newt/native/MacWindow.m @@ -33,7 +33,7 @@ #import <inttypes.h> -#import "com_sun_javafx_newt_macosx_MacWindow.h" +#import "com_jogamp_newt_macosx_MacWindow.h" #import "NewtMacWindow.h" #import "EventListener.h" @@ -121,11 +121,11 @@ NS_ENDHANDLER } /* - * Class: com_sun_javafx_newt_macosx_MacDisplay + * Class: com_jogamp_newt_macosx_MacDisplay * Method: initIDs * Signature: ()Z */ -JNIEXPORT jboolean JNICALL Java_com_sun_javafx_newt_macosx_MacDisplay_initNSApplication +JNIEXPORT jboolean JNICALL Java_com_jogamp_newt_macosx_MacDisplay_initNSApplication (JNIEnv *env, jclass clazz) { static int initialized = 0; @@ -155,11 +155,11 @@ JNIEXPORT jboolean JNICALL Java_com_sun_javafx_newt_macosx_MacDisplay_initNSAppl } /* - * Class: com_sun_javafx_newt_macosx_MacDisplay + * Class: com_jogamp_newt_macosx_MacDisplay * Method: dispatchMessages0 * Signature: ()V */ -JNIEXPORT void JNICALL Java_com_sun_javafx_newt_macosx_MacDisplay_dispatchMessages0 +JNIEXPORT void JNICALL Java_com_jogamp_newt_macosx_MacDisplay_dispatchMessages0 (JNIEnv *env, jobject unused, jlong window, jint eventMask) { NSEvent* event = NULL; @@ -195,11 +195,11 @@ NS_ENDHANDLER } /* - * Class: com_sun_javafx_newt_macosx_MacScreen + * Class: com_jogamp_newt_macosx_MacScreen * Method: getWidthImpl * Signature: (I)I */ -JNIEXPORT jint JNICALL Java_com_sun_javafx_newt_macosx_MacScreen_getWidthImpl +JNIEXPORT jint JNICALL Java_com_jogamp_newt_macosx_MacScreen_getWidthImpl (JNIEnv *env, jclass clazz, jint screen_idx) { NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init]; @@ -216,11 +216,11 @@ JNIEXPORT jint JNICALL Java_com_sun_javafx_newt_macosx_MacScreen_getWidthImpl } /* - * Class: com_sun_javafx_newt_macosx_MacScreen + * Class: com_jogamp_newt_macosx_MacScreen * Method: getHeightImpl * Signature: (I)I */ -JNIEXPORT jint JNICALL Java_com_sun_javafx_newt_macosx_MacScreen_getHeightImpl +JNIEXPORT jint JNICALL Java_com_jogamp_newt_macosx_MacScreen_getHeightImpl (JNIEnv *env, jclass clazz, jint screen_idx) { NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init]; @@ -237,11 +237,11 @@ JNIEXPORT jint JNICALL Java_com_sun_javafx_newt_macosx_MacScreen_getHeightImpl } /* - * Class: com_sun_javafx_newt_macosx_MacWindow + * Class: com_jogamp_newt_macosx_MacWindow * Method: initIDs * Signature: ()Z */ -JNIEXPORT jboolean JNICALL Java_com_sun_javafx_newt_macosx_MacWindow_initIDs +JNIEXPORT jboolean JNICALL Java_com_jogamp_newt_macosx_MacWindow_initIDs (JNIEnv *env, jclass clazz) { static int initialized = 0; @@ -258,11 +258,11 @@ JNIEXPORT jboolean JNICALL Java_com_sun_javafx_newt_macosx_MacWindow_initIDs } /* - * Class: com_sun_javafx_newt_macosx_MacWindow + * Class: com_jogamp_newt_macosx_MacWindow * Method: createWindow0 * Signature: (JIIIIZIIIJ)J */ -JNIEXPORT jlong JNICALL Java_com_sun_javafx_newt_macosx_MacWindow_createWindow0 +JNIEXPORT jlong JNICALL Java_com_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) { @@ -334,11 +334,11 @@ NS_ENDHANDLER } /* - * Class: com_sun_javafx_newt_macosx_MacWindow + * Class: com_jogamp_newt_macosx_MacWindow * Method: makeKeyAndOrderFront * Signature: (J)V */ -JNIEXPORT void JNICALL Java_com_sun_javafx_newt_macosx_MacWindow_makeKeyAndOrderFront +JNIEXPORT void JNICALL Java_com_jogamp_newt_macosx_MacWindow_makeKeyAndOrderFront (JNIEnv *env, jobject unused, jlong window) { NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init]; @@ -348,11 +348,11 @@ JNIEXPORT void JNICALL Java_com_sun_javafx_newt_macosx_MacWindow_makeKeyAndOrder } /* - * Class: com_sun_javafx_newt_macosx_MacWindow + * Class: com_jogamp_newt_macosx_MacWindow * Method: makeKey * Signature: (J)V */ -JNIEXPORT void JNICALL Java_com_sun_javafx_newt_macosx_MacWindow_makeKey +JNIEXPORT void JNICALL Java_com_jogamp_newt_macosx_MacWindow_makeKey (JNIEnv *env, jobject unused, jlong window) { NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init]; @@ -362,11 +362,11 @@ JNIEXPORT void JNICALL Java_com_sun_javafx_newt_macosx_MacWindow_makeKey } /* - * Class: com_sun_javafx_newt_macosx_MacWindow + * Class: com_jogamp_newt_macosx_MacWindow * Method: orderOut * Signature: (J)V */ -JNIEXPORT void JNICALL Java_com_sun_javafx_newt_macosx_MacWindow_orderOut +JNIEXPORT void JNICALL Java_com_jogamp_newt_macosx_MacWindow_orderOut (JNIEnv *env, jobject unused, jlong window) { NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init]; @@ -376,11 +376,11 @@ JNIEXPORT void JNICALL Java_com_sun_javafx_newt_macosx_MacWindow_orderOut } /* - * Class: com_sun_javafx_newt_macosx_MacWindow + * Class: com_jogamp_newt_macosx_MacWindow * Method: close0 * Signature: (J)V */ -JNIEXPORT void JNICALL Java_com_sun_javafx_newt_macosx_MacWindow_close0 +JNIEXPORT void JNICALL Java_com_jogamp_newt_macosx_MacWindow_close0 (JNIEnv *env, jobject unused, jlong window) { NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init]; @@ -401,11 +401,11 @@ NS_ENDHANDLER } /* - * Class: com_sun_javafx_newt_macosx_MacWindow + * Class: com_jogamp_newt_macosx_MacWindow * Method: setTitle0 * Signature: (JLjava/lang/String;)V */ -JNIEXPORT void JNICALL Java_com_sun_javafx_newt_macosx_MacWindow_setTitle0 +JNIEXPORT void JNICALL Java_com_jogamp_newt_macosx_MacWindow_setTitle0 (JNIEnv *env, jobject unused, jlong window, jstring title) { NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init]; @@ -417,11 +417,11 @@ JNIEXPORT void JNICALL Java_com_sun_javafx_newt_macosx_MacWindow_setTitle0 } /* - * Class: com_sun_javafx_newt_macosx_MacWindow + * Class: com_jogamp_newt_macosx_MacWindow * Method: contentView * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_com_sun_javafx_newt_macosx_MacWindow_contentView +JNIEXPORT jlong JNICALL Java_com_jogamp_newt_macosx_MacWindow_contentView (JNIEnv *env, jobject unused, jlong window) { NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init]; @@ -432,11 +432,11 @@ JNIEXPORT jlong JNICALL Java_com_sun_javafx_newt_macosx_MacWindow_contentView } /* - * Class: com_sun_javafx_newt_macosx_MacWindow + * Class: com_jogamp_newt_macosx_MacWindow * Method: changeContentView * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_com_sun_javafx_newt_macosx_MacWindow_changeContentView +JNIEXPORT jlong JNICALL Java_com_jogamp_newt_macosx_MacWindow_changeContentView (JNIEnv *env, jobject jthis, jlong parent, jlong window, jlong jview) { NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init]; @@ -452,11 +452,11 @@ JNIEXPORT jlong JNICALL Java_com_sun_javafx_newt_macosx_MacWindow_changeContentV } /* - * Class: com_sun_javafx_newt_macosx_MacWindow + * Class: com_jogamp_newt_macosx_MacWindow * Method: setContentSize * Signature: (JII)V */ -JNIEXPORT void JNICALL Java_com_sun_javafx_newt_macosx_MacWindow_setContentSize +JNIEXPORT void JNICALL Java_com_jogamp_newt_macosx_MacWindow_setContentSize (JNIEnv *env, jobject unused, jlong window, jint w, jint h) { NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init]; @@ -467,11 +467,11 @@ JNIEXPORT void JNICALL Java_com_sun_javafx_newt_macosx_MacWindow_setContentSize } /* - * Class: com_sun_javafx_newt_macosx_MacWindow + * Class: com_jogamp_newt_macosx_MacWindow * Method: setFrameTopLeftPoint * Signature: (JII)V */ -JNIEXPORT void JNICALL Java_com_sun_javafx_newt_macosx_MacWindow_setFrameTopLeftPoint +JNIEXPORT void JNICALL Java_com_jogamp_newt_macosx_MacWindow_setFrameTopLeftPoint (JNIEnv *env, jobject unused, jlong parent, jlong window, jint x, jint y) { NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init]; diff --git a/src/newt/native/NewtMacWindow.h b/src/newt/native/NewtMacWindow.h index e19be2ed8..560cfe408 100644 --- a/src/newt/native/NewtMacWindow.h +++ b/src/newt/native/NewtMacWindow.h @@ -55,7 +55,7 @@ @end -@interface NewtMacWindow : NSWindow +@interface NewtMacWindow : NSWindow <NSWindowDelegate> { } diff --git a/src/newt/native/NewtMacWindow.m b/src/newt/native/NewtMacWindow.m index 146c04de1..3d8d32a40 100755 --- a/src/newt/native/NewtMacWindow.m +++ b/src/newt/native/NewtMacWindow.m @@ -441,7 +441,7 @@ static jint mods2JavaMods(NSUInteger mods) } (*env)->CallVoidMethod(env, javaWindowObject, windowDestroyNotifyID); - // Will be called by Window.java (*env)->CallVoidMethod(env, javaWindowObject, windowDestroyedID); + (*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/WindowsWindow.c b/src/newt/native/WindowsWindow.c index 5445ca372..67da99b1f 100755 --- a/src/newt/native/WindowsWindow.c +++ b/src/newt/native/WindowsWindow.c @@ -89,7 +89,7 @@ #define MONITOR_DEFAULTTONEAREST 2 #endif -#include "com_sun_javafx_newt_windows_WindowsWindow.h" +#include "com_jogamp_newt_windows_WindowsWindow.h" #include "EventListener.h" #include "MouseEvent.h" @@ -902,11 +902,11 @@ static LRESULT CALLBACK wndProc(HWND wnd, UINT message, } /* - * Class: com_sun_javafx_newt_windows_WindowsDisplay + * Class: com_jogamp_newt_windows_WindowsDisplay * Method: DispatchMessages * Signature: ()V */ -JNIEXPORT void JNICALL Java_com_sun_javafx_newt_windows_WindowsDisplay_DispatchMessages +JNIEXPORT void JNICALL Java_com_jogamp_newt_windows_WindowsDisplay_DispatchMessages (JNIEnv *env, jclass clazz) { int i = 0; @@ -925,11 +925,11 @@ JNIEXPORT void JNICALL Java_com_sun_javafx_newt_windows_WindowsDisplay_DispatchM } /* - * Class: com_sun_javafx_newt_windows_WindowsDisplay + * Class: com_jogamp_newt_windows_WindowsDisplay * Method: LoadLibraryW * Signature: (Ljava/lang/String;)J */ -JNIEXPORT jlong JNICALL Java_com_sun_javafx_newt_windows_WindowsDisplay_LoadLibraryW +JNIEXPORT jlong JNICALL Java_com_jogamp_newt_windows_WindowsDisplay_LoadLibraryW (JNIEnv *env, jclass clazz, jstring dllName) { jchar* _dllName = GetNullTerminatedStringChars(env, dllName); @@ -939,11 +939,11 @@ JNIEXPORT jlong JNICALL Java_com_sun_javafx_newt_windows_WindowsDisplay_LoadLibr } /* - * Class: com_sun_javafx_newt_windows_WindowsDisplay + * Class: com_jogamp_newt_windows_WindowsDisplay * Method: RegisterWindowClass * Signature: (Ljava/lang/String;J)I */ -JNIEXPORT jint JNICALL Java_com_sun_javafx_newt_windows_WindowsDisplay_RegisterWindowClass +JNIEXPORT jint JNICALL Java_com_jogamp_newt_windows_WindowsDisplay_RegisterWindowClass (JNIEnv *env, jclass clazz, jstring wndClassName, jlong hInstance) { ATOM res; @@ -979,44 +979,44 @@ JNIEXPORT jint JNICALL Java_com_sun_javafx_newt_windows_WindowsDisplay_RegisterW } /* - * Class: com_sun_javafx_newt_windows_WindowsDisplay + * Class: com_jogamp_newt_windows_WindowsDisplay * Method: CleanupWindowResources * Signature: (java/lang/String;J)V */ -JNIEXPORT void JNICALL Java_com_sun_javafx_newt_windows_WindowsDisplay_UnregisterWindowClass +JNIEXPORT void JNICALL Java_com_jogamp_newt_windows_WindowsDisplay_UnregisterWindowClass (JNIEnv *env, jclass clazz, jint wndClassAtom, jlong hInstance) { UnregisterClass(MAKEINTATOM(wndClassAtom), (HINSTANCE) (intptr_t) hInstance); } /* - * Class: com_sun_javafx_newt_windows_WindowsScreen + * Class: com_jogamp_newt_windows_WindowsScreen * Method: getWidthImpl * Signature: (I)I */ -JNIEXPORT jint JNICALL Java_com_sun_javafx_newt_windows_WindowsScreen_getWidthImpl +JNIEXPORT jint JNICALL Java_com_jogamp_newt_windows_WindowsScreen_getWidthImpl (JNIEnv *env, jobject obj, jint scrn_idx) { return (jint)GetSystemMetrics(SM_CXSCREEN); } /* - * Class: com_sun_javafx_newt_windows_WindowsScreen + * Class: com_jogamp_newt_windows_WindowsScreen * Method: getWidthImpl * Signature: (I)I */ -JNIEXPORT jint JNICALL Java_com_sun_javafx_newt_windows_WindowsScreen_getHeightImpl +JNIEXPORT jint JNICALL Java_com_jogamp_newt_windows_WindowsScreen_getHeightImpl (JNIEnv *env, jobject obj, jint scrn_idx) { return (jint)GetSystemMetrics(SM_CYSCREEN); } /* - * Class: com_sun_javafx_newt_windows_WindowsWindow + * Class: com_jogamp_newt_windows_WindowsWindow * Method: initIDs * Signature: ()Z */ -JNIEXPORT jboolean JNICALL Java_com_sun_javafx_newt_windows_WindowsWindow_initIDs +JNIEXPORT jboolean JNICALL Java_com_jogamp_newt_windows_WindowsWindow_initIDs (JNIEnv *env, jclass clazz) { sizeChangedID = (*env)->GetMethodID(env, clazz, "sizeChanged", "(II)V"); @@ -1045,11 +1045,11 @@ JNIEXPORT jboolean JNICALL Java_com_sun_javafx_newt_windows_WindowsWindow_initID } /* - * Class: com_sun_javafx_newt_windows_WindowsWindow + * Class: com_jogamp_newt_windows_WindowsWindow * Method: CreateWindow * Signature: (JILjava/lang/String;JJZIIII)J */ -JNIEXPORT jlong JNICALL Java_com_sun_javafx_newt_windows_WindowsWindow_CreateWindow +JNIEXPORT jlong JNICALL Java_com_jogamp_newt_windows_WindowsWindow_CreateWindow (JNIEnv *env, jobject obj, jlong parent, jint wndClassAtom, jstring jWndName, jlong hInstance, jlong visualID, jboolean bIsUndecorated, jint jx, jint jy, jint defaultWidth, jint defaultHeight) @@ -1113,44 +1113,44 @@ JNIEXPORT jlong JNICALL Java_com_sun_javafx_newt_windows_WindowsWindow_CreateWin } /* - * Class: com_sun_javafx_newt_windows_WindowsWindow + * Class: com_jogamp_newt_windows_WindowsWindow * Method: DestroyWindow * Signature: (J)V */ -JNIEXPORT void JNICALL Java_com_sun_javafx_newt_windows_WindowsWindow_DestroyWindow +JNIEXPORT void JNICALL Java_com_jogamp_newt_windows_WindowsWindow_DestroyWindow (JNIEnv *env, jobject obj, jlong window) { DestroyWindow((HWND) (intptr_t) window); } /* - * Class: com_sun_javafx_newt_windows_WindowsWindow + * Class: com_jogamp_newt_windows_WindowsWindow * Method: GetDC * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_com_sun_javafx_newt_windows_WindowsWindow_GetDC +JNIEXPORT jlong JNICALL Java_com_jogamp_newt_windows_WindowsWindow_GetDC (JNIEnv *env, jobject obj, jlong window) { return (jlong) (intptr_t) GetDC((HWND) (intptr_t) window); } /* - * Class: com_sun_javafx_newt_windows_WindowsWindow + * Class: com_jogamp_newt_windows_WindowsWindow * Method: ReleaseDC * Signature: (JJ)V */ -JNIEXPORT void JNICALL Java_com_sun_javafx_newt_windows_WindowsWindow_ReleaseDC +JNIEXPORT void JNICALL Java_com_jogamp_newt_windows_WindowsWindow_ReleaseDC (JNIEnv *env, jobject obj, jlong window, jlong dc) { ReleaseDC((HWND) (intptr_t) window, (HDC) (intptr_t) dc); } /* - * Class: com_sun_javafx_newt_windows_WindowsWindow + * Class: com_jogamp_newt_windows_WindowsWindow * Method: MonitorFromWindow * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_com_sun_javafx_newt_windows_WindowsWindow_MonitorFromWindow +JNIEXPORT jlong JNICALL Java_com_jogamp_newt_windows_WindowsWindow_MonitorFromWindow (JNIEnv *env, jobject obj, jlong window) { #if (_WIN32_WINNT >= 0x0500 || _WIN32_WINDOWS >= 0x0410 || WINVER >= 0x0500) && !defined(_WIN32_WCE) @@ -1161,11 +1161,11 @@ JNIEXPORT jlong JNICALL Java_com_sun_javafx_newt_windows_WindowsWindow_MonitorFr } /* - * Class: com_sun_javafx_newt_windows_WindowsWindow + * Class: com_jogamp_newt_windows_WindowsWindow * Method: setVisible0 * Signature: (JZ)V */ -JNIEXPORT void JNICALL Java_com_sun_javafx_newt_windows_WindowsWindow_setVisible0 +JNIEXPORT void JNICALL Java_com_jogamp_newt_windows_WindowsWindow_setVisible0 (JNIEnv *_env, jclass clazz, jlong window, jboolean visible) { HWND hWnd = (HWND) (intptr_t) window; @@ -1178,11 +1178,11 @@ JNIEXPORT void JNICALL Java_com_sun_javafx_newt_windows_WindowsWindow_setVisible } /* - * Class: com_sun_javafx_newt_windows_WindowsWindow + * Class: com_jogamp_newt_windows_WindowsWindow * Method: setSize0 * Signature: (JII)V */ -JNIEXPORT void JNICALL Java_com_sun_javafx_newt_windows_WindowsWindow_setSize0 +JNIEXPORT void JNICALL Java_com_jogamp_newt_windows_WindowsWindow_setSize0 (JNIEnv *env, jobject obj, jlong parent, jlong window, jint x, jint y, jint width, jint height) { HWND hwndP = (HWND) (intptr_t) parent; @@ -1215,11 +1215,11 @@ JNIEXPORT void JNICALL Java_com_sun_javafx_newt_windows_WindowsWindow_setSize0 } /* - * Class: com_sun_javafx_newt_windows_WindowsWindow + * Class: com_jogamp_newt_windows_WindowsWindow * Method: setPosition * Signature: (JII)V */ -JNIEXPORT void JNICALL Java_com_sun_javafx_newt_windows_WindowsWindow_setPosition +JNIEXPORT void JNICALL Java_com_jogamp_newt_windows_WindowsWindow_setPosition (JNIEnv *env, jobject obj, jlong parent, jlong window, jint x, jint y) { UINT flags = SWP_NOACTIVATE | SWP_NOSIZE; @@ -1236,11 +1236,11 @@ JNIEXPORT void JNICALL Java_com_sun_javafx_newt_windows_WindowsWindow_setPositio } /* - * Class: com_sun_javafx_newt_windows_WindowsWindow + * Class: com_jogamp_newt_windows_WindowsWindow * Method: setFullscreen * Signature: (JIIIIZZ)V */ -JNIEXPORT void JNICALL Java_com_sun_javafx_newt_windows_WindowsWindow_setFullscreen0 +JNIEXPORT void JNICALL Java_com_jogamp_newt_windows_WindowsWindow_setFullscreen0 (JNIEnv *env, jobject obj, jlong parent, jlong window, jint x, jint y, jint width, jint height, jboolean bIsUndecorated, jboolean on) { UINT flags; @@ -1272,11 +1272,11 @@ JNIEXPORT void JNICALL Java_com_sun_javafx_newt_windows_WindowsWindow_setFullscr } /* - * Class: com_sun_javafx_newt_windows_WindowsWindow + * Class: com_jogamp_newt_windows_WindowsWindow * Method: setTitle * Signature: (JLjava/lang/String;)V */ -JNIEXPORT void JNICALL Java_com_sun_javafx_newt_windows_WindowsWindow_setTitle +JNIEXPORT void JNICALL Java_com_jogamp_newt_windows_WindowsWindow_setTitle (JNIEnv *env, jclass clazz, jlong window, jstring title) { HWND hwnd = (HWND) (intptr_t) window; @@ -1290,11 +1290,11 @@ JNIEXPORT void JNICALL Java_com_sun_javafx_newt_windows_WindowsWindow_setTitle } /* - * Class: com_sun_javafx_newt_windows_WindowsWindow + * Class: com_jogamp_newt_windows_WindowsWindow * Method: requestFocus * Signature: (J)V */ -JNIEXPORT void JNICALL Java_com_sun_javafx_newt_windows_WindowsWindow_requestFocus +JNIEXPORT void JNICALL Java_com_jogamp_newt_windows_WindowsWindow_requestFocus (JNIEnv *env, jclass clazz, jlong window) { HWND hwnd = (HWND) (intptr_t) window; diff --git a/src/newt/native/X11Window.c b/src/newt/native/X11Window.c index b6b2bbe26..27ca8e6a0 100755 --- a/src/newt/native/X11Window.c +++ b/src/newt/native/X11Window.c @@ -46,7 +46,7 @@ #include <X11/Xutil.h> #include <X11/keysym.h> -#include "com_sun_javafx_newt_x11_X11Window.h" +#include "com_jogamp_newt_x11_X11Window.h" #include "EventListener.h" #include "MouseEvent.h" @@ -149,12 +149,25 @@ static jint X11KeySym2NewtVKey(KeySym keySym) { return keySym; } -static const char * const ClazzNameRuntimeException = - "java/lang/RuntimeException"; +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, buffer); + fprintf(stderr, "\n"); + (*env)->FatalError(env, buffer); +} + +static const char * const ClazzNameRuntimeException = "java/lang/RuntimeException"; static jclass runtimeExceptionClz=NULL; static const char * const ClazzNameNewtWindow = - "com/sun/javafx/newt/Window"; + "com/jogamp/newt/Window"; static jclass newtWindowClz=NULL; static jmethodID windowChangedID = NULL; @@ -186,18 +199,51 @@ static void _throwNewRuntimeException(Display * unlockDisplay, JNIEnv *env, cons * Display */ + +static JNIEnv * x11ErrorHandlerJNIEnv = NULL; +static XErrorHandler origErrorHandler = NULL ; + +static int displayDispatchErrorHandler(Display *dpy, XErrorEvent *e) +{ + fprintf(stderr, "Warning: NEWT X11 Error: DisplayDispatch %p, Code 0x%X\n", dpy, e->error_code); + + if (e->error_code == BadAtom) + { + fprintf(stderr, " BadAtom (%p): Atom probably already removed\n", e->resourceid); + } else if (e->error_code == BadWindow) + { + fprintf(stderr, " BadWindow (%p): Window probably already removed\n", e->resourceid); + } else { + _throwNewRuntimeException(NULL, x11ErrorHandlerJNIEnv, "NEWT X11 Error: Display %p, Code 0x%X", dpy, e->error_code); + } + + return 0; +} + +static void displayDispatchErrorHandlerEnable(int onoff, JNIEnv * env) { + if(onoff) { + if(NULL==origErrorHandler) { + x11ErrorHandlerJNIEnv = env; + origErrorHandler = XSetErrorHandler(displayDispatchErrorHandler); + } + } else { + XSetErrorHandler(origErrorHandler); + origErrorHandler = NULL; + } +} + /* - * Class: com_sun_javafx_newt_x11_X11Display + * Class: com_jogamp_newt_x11_X11Display * Method: initIDs * Signature: ()Z */ -JNIEXPORT jboolean JNICALL Java_com_sun_javafx_newt_x11_X11Display_initIDs +JNIEXPORT jboolean JNICALL Java_com_jogamp_newt_x11_X11Display_initIDs (JNIEnv *env, jclass clazz) { jclass c; if( 0 == XInitThreads() ) { - fprintf(stderr, "Warning: XInitThreads() failed\n"); + fprintf(stderr, "Warning: NEWT X11Window: XInitThreads() failed\n"); } displayCompletedID = (*env)->GetMethodID(env, clazz, "displayCompleted", "(JJ)V"); @@ -208,28 +254,24 @@ JNIEXPORT jboolean JNICALL Java_com_sun_javafx_newt_x11_X11Display_initIDs if(NULL==newtWindowClz) { c = (*env)->FindClass(env, ClazzNameNewtWindow); if(NULL==c) { - fprintf(stderr, "FatalError: NEWT X11Window: can't find %s\n", ClazzNameNewtWindow); - return JNI_FALSE; + _FatalError(env, "NEWT X11Window: can't find %s", ClazzNameNewtWindow); } newtWindowClz = (jclass)(*env)->NewGlobalRef(env, c); (*env)->DeleteLocalRef(env, c); if(NULL==newtWindowClz) { - fprintf(stderr, "FatalError: NEWT X11Window: can't use %s\n", ClazzNameNewtWindow); - return JNI_FALSE; + _FatalError(env, "NEWT X11Window: can't use %s", ClazzNameNewtWindow); } } if(NULL==runtimeExceptionClz) { c = (*env)->FindClass(env, ClazzNameRuntimeException); if(NULL==c) { - fprintf(stderr, "FatalError: NEWT X11Window: can't find %s\n", ClazzNameRuntimeException); - return JNI_FALSE; + _FatalError(env, "NEWT X11Window: can't find %s", ClazzNameRuntimeException); } runtimeExceptionClz = (jclass)(*env)->NewGlobalRef(env, c); (*env)->DeleteLocalRef(env, c); if(NULL==runtimeExceptionClz) { - fprintf(stderr, "FatalError: NEWT X11Window: can't use %s\n", ClazzNameRuntimeException); - return JNI_FALSE; + _FatalError(env, "NEWT X11Window: can't use %s", ClazzNameRuntimeException); } } @@ -237,43 +279,45 @@ JNIEXPORT jboolean JNICALL Java_com_sun_javafx_newt_x11_X11Display_initIDs } /* - * Class: com_sun_javafx_newt_x11_X11Display + * Class: com_jogamp_newt_x11_X11Display * Method: LockDisplay * Signature: (J)V */ -JNIEXPORT void JNICALL Java_com_sun_javafx_newt_x11_X11Display_LockDisplay +JNIEXPORT void JNICALL Java_com_jogamp_newt_x11_X11Display_LockDisplay (JNIEnv *env, jobject obj, jlong display) { Display * dpy = (Display *)(intptr_t)display; if(dpy==NULL) { - _throwNewRuntimeException(NULL, env, "given display connection is NULL\n"); + _FatalError(env, "invalid display connection.."); } XLockDisplay(dpy) ; + // DBG_PRINT1( "X11: LockDisplay 0x%X\n", dpy); } /* - * Class: com_sun_javafx_newt_x11_X11Display + * Class: com_jogamp_newt_x11_X11Display * Method: UnlockDisplay * Signature: (J)V */ -JNIEXPORT void JNICALL Java_com_sun_javafx_newt_x11_X11Display_UnlockDisplay +JNIEXPORT void JNICALL Java_com_jogamp_newt_x11_X11Display_UnlockDisplay (JNIEnv *env, jobject obj, jlong display) { Display * dpy = (Display *)(intptr_t)display; if(dpy==NULL) { - _throwNewRuntimeException(NULL, env, "given display connection is NULL\n"); + _FatalError(env, "invalid display connection.."); } XUnlockDisplay(dpy) ; + // DBG_PRINT1( "X11: UnlockDisplay 0x%X\n", dpy); } /* - * Class: com_sun_javafx_newt_x11_X11Display + * Class: com_jogamp_newt_x11_X11Display * Method: CompleteDisplay * Signature: (J)V */ -JNIEXPORT void JNICALL Java_com_sun_javafx_newt_x11_X11Display_CompleteDisplay +JNIEXPORT void JNICALL Java_com_jogamp_newt_x11_X11Display_CompleteDisplay (JNIEnv *env, jobject obj, jlong display) { Display * dpy = (Display *)(intptr_t)display; @@ -281,19 +325,19 @@ JNIEXPORT void JNICALL Java_com_sun_javafx_newt_x11_X11Display_CompleteDisplay jlong windowDeleteAtom; if(dpy==NULL) { - _throwNewRuntimeException(NULL, env, "given display connection is NULL\n"); + _FatalError(env, "invalid display connection.."); } XLockDisplay(dpy) ; javaObjectAtom = (jlong) XInternAtom(dpy, "JOGL_JAVA_OBJECT", False); if(None==javaObjectAtom) { - _throwNewRuntimeException(dpy, env, "could not create Atom JOGL_JAVA_OBJECT, bail out!\n"); + _throwNewRuntimeException(dpy, env, "could not create Atom JOGL_JAVA_OBJECT, bail out!"); return; } windowDeleteAtom = (jlong) XInternAtom(dpy, "WM_DELETE_WINDOW", False); if(None==windowDeleteAtom) { - _throwNewRuntimeException(dpy, env, "could not create Atom WM_DELETE_WINDOW, bail out!\n"); + _throwNewRuntimeException(dpy, env, "could not create Atom WM_DELETE_WINDOW, bail out!"); return; } @@ -323,14 +367,13 @@ static uintptr_t getPtrOut32Long(unsigned long * src) { } static void setJavaWindowProperty(JNIEnv *env, Display *dpy, Window window, jlong javaObjectAtom, jobject jwindow) { - unsigned long jogl_java_object_data[2]; + unsigned long jogl_java_object_data[2]; // X11 is based on 'unsigned long' int nitems_32 = putPtrIn32Long( jogl_java_object_data, (uintptr_t) jwindow); { jobject test = (jobject) getPtrOut32Long(jogl_java_object_data); if( ! (jwindow==test) ) { - _throwNewRuntimeException(dpy, env, "Internal Error .. Encoded Window ref not the same %p != %p !\n", jwindow, test); - return; + _FatalError(env, "Internal Error .. Encoded Window ref not the same %p != %p !", jwindow, test); } } @@ -356,14 +399,13 @@ static jobject getJavaWindowProperty(JNIEnv *env, Display *dpy, Window window, j &nitems_return, &bytes_after_return, &jogl_java_object_data_pp); if ( Success != res ) { - _throwNewRuntimeException(dpy, env, "could not fetch Atom JOGL_JAVA_OBJECT window property (res %d) nitems_return %ld, bytes_after_return %ld, bail out!\n", - res, nitems_return, bytes_after_return); + fprintf(stderr, "Warning: NEWT X11Window: Could not fetch Atom JOGL_JAVA_OBJECT window property (res %d) nitems_return %ld, bytes_after_return %ld, result 0!\n", res, nitems_return, bytes_after_return); return NULL; } if(actual_type_return!=(Atom)javaObjectAtom || nitems_return<nitems_32 || NULL==jogl_java_object_data_pp) { XFree(jogl_java_object_data_pp); - _throwNewRuntimeException(dpy, env, "could not fetch Atom JOGL_JAVA_OBJECT window property (res %d) nitems_return %ld, bytes_after_return %ld, actual_type_return %ld, JOGL_JAVA_OBJECT %ld, bail out!\n", + fprintf(stderr, "Warning: NEWT X11Window: Fetched invalid Atom JOGL_JAVA_OBJECT window property (res %d) nitems_return %ld, bytes_after_return %ld, actual_type_return %ld, JOGL_JAVA_OBJECT %ld, result 0!\n", res, nitems_return, bytes_after_return, (long)actual_type_return, javaObjectAtom); return NULL; } @@ -374,18 +416,18 @@ static jobject getJavaWindowProperty(JNIEnv *env, Display *dpy, Window window, j #ifdef VERBOSE_ON if(JNI_FALSE == (*env)->IsInstanceOf(env, jwindow, newtWindowClz)) { - _throwNewRuntimeException(NULL, env, "fetched Atom JOGL_JAVA_OBJECT window is not a NEWT Window: javaWindow 0x%X !\n", jwindow); + _throwNewRuntimeException(dpy, env, "fetched Atom JOGL_JAVA_OBJECT window is not a NEWT Window: javaWindow 0x%X !", jwindow); } #endif return jwindow; } /* - * Class: com_sun_javafx_newt_x11_X11Display + * Class: com_jogamp_newt_x11_X11Display * Method: DispatchMessages * Signature: (JIJJ)V */ -JNIEXPORT void JNICALL Java_com_sun_javafx_newt_x11_X11Display_DispatchMessages +JNIEXPORT void JNICALL Java_com_jogamp_newt_x11_X11Display_DispatchMessages (JNIEnv *env, jobject obj, jlong display, jlong javaObjectAtom, jlong wmDeleteAtom) { Display * dpy = (Display *) (intptr_t) display; @@ -405,10 +447,12 @@ JNIEXPORT void JNICALL Java_com_sun_javafx_newt_x11_X11Display_DispatchMessages XLockDisplay(dpy) ; - // num_events = XPending(dpy); // XEventsQueued(dpy, QueuedAfterFlush); // I/O Flush .. - // num_events = XEventsQueued(dpy, QueuedAlready); // Better, no I/O .. - if ( 0 >= XEventsQueued(dpy, QueuedAlready) ) { + // num_events = XPending(dpy); // I/O Flush .. + // num_events = XEventsQueued(dpy, QueuedAfterFlush); // I/O Flush only of no already queued events are available + // num_events = XEventsQueued(dpy, QueuedAlready); // no I/O Flush at all, doesn't work on some cards (eg ATI) + if ( 0 >= XEventsQueued(dpy, QueuedAfterFlush) ) { XUnlockDisplay(dpy) ; + // DBG_PRINT1( "X11: DispatchMessages 0x%X - Leave 1\n", dpy); return; } @@ -416,19 +460,26 @@ JNIEXPORT void JNICALL Java_com_sun_javafx_newt_x11_X11Display_DispatchMessages num_events--; if( 0==evt.xany.window ) { - _throwNewRuntimeException(dpy, env, "event window NULL, bail out!\n"); + _throwNewRuntimeException(dpy, env, "event window NULL, bail out!"); return ; } if(dpy!=evt.xany.display) { - _throwNewRuntimeException(dpy, env, "wrong display, bail out!\n"); + _throwNewRuntimeException(dpy, env, "wrong display, bail out!"); return ; } + + displayDispatchErrorHandlerEnable(1, env); + jwindow = getJavaWindowProperty(env, dpy, evt.xany.window, javaObjectAtom); + displayDispatchErrorHandlerEnable(0, env); + if(NULL==jwindow) { - // just leave .. _throwNewRuntimeException(env, "could not fetch Java Window object, bail out!\n"); + fprintf(stderr, "Warning: NEWT X11 DisplayDispatch %p, Couldn't handle event %d for invalid X11 window %p\n", + dpy, evt.type, evt.xany.window); XUnlockDisplay(dpy) ; + // DBG_PRINT1( "X11: DispatchMessages 0x%X - Leave 2\n", dpy); return; } @@ -446,6 +497,7 @@ JNIEXPORT void JNICALL Java_com_sun_javafx_newt_x11_X11Display_DispatchMessages } XUnlockDisplay(dpy) ; + // DBG_PRINT3( "X11: DispatchMessages 0x%X - Window %p, Event %d\n", dpy, jwindow, evt.type); switch(evt.type) { case ButtonPress: @@ -532,19 +584,18 @@ JNIEXPORT void JNICALL Java_com_sun_javafx_newt_x11_X11Display_DispatchMessages */ /* - * Class: com_sun_javafx_newt_x11_X11Screen + * Class: com_jogamp_newt_x11_X11Screen * Method: GetScreen * Signature: (JI)J */ -JNIEXPORT jlong JNICALL Java_com_sun_javafx_newt_x11_X11Screen_GetScreen +JNIEXPORT jlong JNICALL Java_com_jogamp_newt_x11_X11Screen_GetScreen (JNIEnv *env, jobject obj, jlong display, jint screen_index) { Display * dpy = (Display *)(intptr_t)display; Screen * scrn= NULL; if(dpy==NULL) { - _throwNewRuntimeException(NULL, env, "invalid display connection..\n"); - return 0; + _FatalError(env, "invalid display connection.."); } XLockDisplay(dpy); @@ -559,14 +610,14 @@ JNIEXPORT jlong JNICALL Java_com_sun_javafx_newt_x11_X11Screen_GetScreen return (jlong) (intptr_t) scrn; } -JNIEXPORT jint JNICALL Java_com_sun_javafx_newt_x11_X11Screen_getWidth0 +JNIEXPORT jint JNICALL Java_com_jogamp_newt_x11_X11Screen_getWidth0 (JNIEnv *env, jobject obj, jlong display, jint scrn_idx) { Display * dpy = (Display *) (intptr_t) display; return (jint) XDisplayWidth( dpy, scrn_idx); } -JNIEXPORT jint JNICALL Java_com_sun_javafx_newt_x11_X11Screen_getHeight0 +JNIEXPORT jint JNICALL Java_com_jogamp_newt_x11_X11Screen_getHeight0 (JNIEnv *env, jobject obj, jlong display, jint scrn_idx) { Display * dpy = (Display *) (intptr_t) display; @@ -579,11 +630,11 @@ JNIEXPORT jint JNICALL Java_com_sun_javafx_newt_x11_X11Screen_getHeight0 */ /* - * Class: com_sun_javafx_newt_x11_X11Window + * Class: com_jogamp_newt_x11_X11Window * Method: initIDs * Signature: ()Z */ -JNIEXPORT jboolean JNICALL Java_com_sun_javafx_newt_x11_X11Window_initIDs +JNIEXPORT jboolean JNICALL Java_com_jogamp_newt_x11_X11Window_initIDs (JNIEnv *env, jclass clazz) { windowChangedID = (*env)->GetMethodID(env, clazz, "windowChanged", "(IIII)V"); @@ -605,11 +656,11 @@ JNIEXPORT jboolean JNICALL Java_com_sun_javafx_newt_x11_X11Window_initIDs } /* - * Class: com_sun_javafx_newt_x11_X11Window + * Class: com_jogamp_newt_x11_X11Window * Method: CreateWindow * Signature: (JJIJIIII)J */ -JNIEXPORT jlong JNICALL Java_com_sun_javafx_newt_x11_X11Window_CreateWindow +JNIEXPORT jlong JNICALL Java_com_jogamp_newt_x11_X11Window_CreateWindow (JNIEnv *env, jobject obj, jlong parent, jlong display, jint screen_index, jlong visualID, jlong javaObjectAtom, jlong windowDeleteAtom, @@ -635,12 +686,11 @@ JNIEXPORT jlong JNICALL Java_com_sun_javafx_newt_x11_X11Window_CreateWindow DBG_PRINT4( "X11: CreateWindow %x/%d %dx%d\n", x, y, width, height); if(dpy==NULL) { - _throwNewRuntimeException(NULL, env, "invalid display connection..\n"); - return 0; + _FatalError(env, "invalid display connection.."); } if(visualID<0) { - _throwNewRuntimeException(NULL, env, "invalid VisualID ..\n"); + _throwNewRuntimeException(NULL, env, "invalid VisualID .."); return 0; } @@ -648,7 +698,7 @@ JNIEXPORT jlong JNICALL Java_com_sun_javafx_newt_x11_X11Window_CreateWindow XSync(dpy, False); - scrn = ScreenOfDisplay(dpy, screen_index); + scrn = ScreenOfDisplay(dpy, scrn_idx); // try given VisualID on screen memset(&visualTemplate, 0, sizeof(XVisualInfo)); @@ -667,7 +717,7 @@ JNIEXPORT jlong JNICALL Java_com_sun_javafx_newt_x11_X11Window_CreateWindow if (visual==NULL) { - _throwNewRuntimeException(dpy, env, "could not query Visual by given VisualID, bail out!\n"); + _throwNewRuntimeException(dpy, env, "could not query Visual by given VisualID, bail out!"); return 0; } @@ -734,11 +784,11 @@ JNIEXPORT jlong JNICALL Java_com_sun_javafx_newt_x11_X11Window_CreateWindow } /* - * Class: com_sun_javafx_newt_x11_X11Window + * Class: com_jogamp_newt_x11_X11Window * Method: CloseWindow * Signature: (JJ)V */ -JNIEXPORT void JNICALL Java_com_sun_javafx_newt_x11_X11Window_CloseWindow +JNIEXPORT void JNICALL Java_com_jogamp_newt_x11_X11Window_CloseWindow (JNIEnv *env, jobject obj, jlong display, jlong window, jlong javaObjectAtom) { Display * dpy = (Display *) (intptr_t) display; @@ -746,18 +796,17 @@ JNIEXPORT void JNICALL Java_com_sun_javafx_newt_x11_X11Window_CloseWindow jobject jwindow; if(dpy==NULL) { - _throwNewRuntimeException(NULL, env, "invalid display connection..\n"); - return; + _FatalError(env, "invalid display connection.."); } XLockDisplay(dpy) ; jwindow = getJavaWindowProperty(env, dpy, w, javaObjectAtom); if(NULL==jwindow) { - _throwNewRuntimeException(dpy, env, "could not fetch Java Window object, bail out!\n"); + _throwNewRuntimeException(dpy, env, "could not fetch Java Window object, bail out!"); return; } if ( JNI_FALSE == (*env)->IsSameObject(env, jwindow, obj) ) { - _throwNewRuntimeException(dpy, env, "Internal Error .. Window global ref not the same!\n"); + _throwNewRuntimeException(dpy, env, "Internal Error .. Window global ref not the same!"); return; } (*env)->DeleteGlobalRef(env, jwindow); @@ -779,11 +828,11 @@ JNIEXPORT void JNICALL Java_com_sun_javafx_newt_x11_X11Window_CloseWindow } /* - * Class: com_sun_javafx_newt_x11_X11Window + * Class: com_jogamp_newt_x11_X11Window * Method: setVisible0 * Signature: (JJZ)V */ -JNIEXPORT void JNICALL Java_com_sun_javafx_newt_x11_X11Window_setVisible0 +JNIEXPORT void JNICALL Java_com_jogamp_newt_x11_X11Window_setVisible0 (JNIEnv *env, jobject obj, jlong display, jlong window, jboolean visible) { Display * dpy = (Display *) (intptr_t) display; @@ -791,8 +840,7 @@ JNIEXPORT void JNICALL Java_com_sun_javafx_newt_x11_X11Window_setVisible0 DBG_PRINT1( "X11: setVisible0 vis %d\n", visible); if(dpy==NULL) { - _throwNewRuntimeException(NULL, env, "invalid display connection..\n"); - return; + _FatalError(env, "invalid display connection.."); } XLockDisplay(dpy) ; @@ -823,11 +871,11 @@ JNIEXPORT void JNICALL Java_com_sun_javafx_newt_x11_X11Window_setVisible0 #endif /* - * Class: com_sun_javafx_newt_x11_X11Window + * Class: com_jogamp_newt_x11_X11Window * Method: setSize0 * Signature: (JIJIIIIIZ)V */ -JNIEXPORT void JNICALL Java_com_sun_javafx_newt_x11_X11Window_setSize0 +JNIEXPORT void JNICALL Java_com_jogamp_newt_x11_X11Window_setSize0 (JNIEnv *env, jobject obj, jlong jparent, jlong display, jint screen_index, jlong window, jint x, jint y, jint width, jint height, jint decorationToggle, jboolean setVisible) { Display * dpy = (Display *) (intptr_t) display; @@ -840,8 +888,7 @@ JNIEXPORT void JNICALL Java_com_sun_javafx_newt_x11_X11Window_setSize0 DBG_PRINT6( "X11: setSize0 %d/%d %dx%d, dec %d, vis %d\n", x, y, width, height, decorationToggle, setVisible); if(dpy==NULL) { - _throwNewRuntimeException(NULL, env, "invalid display connection..\n"); - return; + _FatalError(env, "invalid display connection.."); } XLockDisplay(dpy) ; @@ -887,11 +934,11 @@ JNIEXPORT void JNICALL Java_com_sun_javafx_newt_x11_X11Window_setSize0 } /* - * Class: com_sun_javafx_newt_x11_X11Window + * Class: com_jogamp_newt_x11_X11Window * Method: setPosition0 * Signature: (JJII)V */ -JNIEXPORT void JNICALL Java_com_sun_javafx_newt_x11_X11Window_setPosition0 +JNIEXPORT void JNICALL Java_com_jogamp_newt_x11_X11Window_setPosition0 (JNIEnv *env, jobject obj, jlong display, jlong window, jint x, jint y) { Display * dpy = (Display *) (intptr_t) display; @@ -900,8 +947,7 @@ JNIEXPORT void JNICALL Java_com_sun_javafx_newt_x11_X11Window_setPosition0 DBG_PRINT2( "X11: setPos0 . XConfigureWindow %d/%d\n", x, y); if(dpy==NULL) { - _throwNewRuntimeException(NULL, env, "invalid display connection..\n"); - return; + _FatalError(env, "invalid display connection.."); } XLockDisplay(dpy) ; diff --git a/test/Issue326Test1.java b/test/Issue326Test1.java index 42b6ec0c7..217c2819b 100755 --- a/test/Issue326Test1.java +++ b/test/Issue326Test1.java @@ -13,8 +13,8 @@ import javax.media.opengl.GLCanvas; import javax.media.opengl.GLEventListener; import javax.media.opengl.glu.GLU; -import com.sun.opengl.util.Animator; -import com.sun.opengl.util.j2d.TextRenderer; +import com.jogamp.opengl.util.Animator; +import com.jogamp.opengl.util.j2d.TextRenderer; /** * Demonstrates corruption with older versions of TextRenderer. Two @@ -65,7 +65,7 @@ public class Issue326Test1 extends Frame implements GLEventListener { gl.glLoadIdentity(); tr.beginRendering(800,800); - tr.draw( "die Marktwirtschaft. Da regelt sich � angeblich", 16, 32); + tr.draw( "die Marktwirtschaft. Da regelt sich � angeblich", 16, 32); tr.draw( "Hello World! This text is scrambled", 16, 16); tr.endRendering(); diff --git a/test/Issue326Test2.java b/test/Issue326Test2.java index f2258c858..10ec4417b 100755 --- a/test/Issue326Test2.java +++ b/test/Issue326Test2.java @@ -2,7 +2,7 @@ import java.awt.Font; import java.awt.Frame; import java.awt.event.*; import javax.media.opengl.*; -import com.sun.opengl.util.j2d.*; +import com.jogamp.opengl.util.j2d.*; /** * Another test case demonstrating corruption with older version of diff --git a/test/Issue344Base.java b/test/Issue344Base.java index 548e3ec21..6d0c99290 100755 --- a/test/Issue344Base.java +++ b/test/Issue344Base.java @@ -7,8 +7,8 @@ import java.awt.geom.*; import javax.media.opengl.*; import javax.media.opengl.glu.*; -import com.sun.opengl.util.*; -import com.sun.opengl.util.j2d.*; +import com.jogamp.opengl.util.*; +import com.jogamp.opengl.util.j2d.*; /** Test Code adapted from TextCube.java (in JOGL demos) * diff --git a/tools/jackpotc/.gitignore b/tools/jackpotc/.gitignore new file mode 100644 index 000000000..a65b41774 --- /dev/null +++ b/tools/jackpotc/.gitignore @@ -0,0 +1 @@ +lib diff --git a/tools/jackpotc/bttf b/tools/jackpotc/bttf new file mode 100755 index 000000000..51472c568 --- /dev/null +++ b/tools/jackpotc/bttf @@ -0,0 +1,8 @@ +#!/bin/bash +SRC="./test/oldgears/src/" +LIBS="./test/oldgears/lib/jogl.jar:./test/oldgears/lib/jogl.all.jar:./test/oldgears/lib/jogl.awt.jar" +OUTPUT="./test/oldgears/build" + +echo "Back to the Future" +mkdir $OUTPUT +./lib/jackpotc -sourcepath $SRC -cp $LIBS -d $OUTPUT -Ajackpot30_extra_hints=./jogl1Tojogl2.hint `find $SRC -type f -name "*.java"` diff --git a/tools/jackpotc/jackpotc b/tools/jackpotc/jackpotc new file mode 100755 index 000000000..6b0216d76 --- /dev/null +++ b/tools/jackpotc/jackpotc @@ -0,0 +1,2 @@ +#!/bin/bash +java -Xbootclasspath/p:`dirname $0`/jackpotc.jar com.sun.tools.javac.Main -Xjcov "$@" diff --git a/tools/jackpotc/jogl1Tojogl2.hint b/tools/jackpotc/jogl1Tojogl2.hint new file mode 100644 index 000000000..9352c959e --- /dev/null +++ b/tools/jackpotc/jogl1Tojogl2.hint @@ -0,0 +1,22 @@ +// rules for automatic jogl 1.1.1 -> jogl 2 refactorings + +//'JOGL2 API change: javax.media.opengl.GLCanvas -> javax.media.opengl.awt.GLCanvas': +//javax.media.opengl.GLCanvas=>javax.media.opengl.awt.GLCanvas;; + +//'JOGL2 API change: javax.media.opengl.GLJPanel -> javax.media.opengl.awt.GLJPanel': +//javax.media.opengl.GLJPanel=>javax.media.opengl.awt.GLJPanel;; + +'JOGL2 API change: javax.media.opengl.GL -> javax.media.opengl.GL2': +javax.media.opengl.GL=>javax.media.opengl.GL2;; + +'JOGL2 API change: new javax.media.opengl.GLCapabilities(javax.media.opengl.GLProfile)': +new javax.media.opengl.GLCapabilities()=> +new javax.media.opengl.GLCapabilities(javax.media.opengl.GLProfile.get(javax.media.opengl.GLProfile.GL2));; + +'JOGL2 API change: GL gl = drawable.getGL() -> GL2 gl = drawable.getGL().getGL2()': +$d.getGL() :: $d instanceof javax.media.opengl.GLAutoDrawable=> +$d.getGL().getGL2();; + +//public void init($D $drawable)=> +//public void dispose(GLAutoDrawable drawable){} +//public void init($D $drawable);; diff --git a/tools/jackpotc/setup b/tools/jackpotc/setup new file mode 100755 index 000000000..f1ccc57ed --- /dev/null +++ b/tools/jackpotc/setup @@ -0,0 +1,5 @@ +#!/bin/bash +mkdir lib +cd ./lib +wget http://bitbucket.org/jlahoda/jackpot30/downloads/jackpotc.zip +unzip -oj jackpotc.zip diff --git a/tools/jackpotc/test/oldgears/.gitignore b/tools/jackpotc/test/oldgears/.gitignore new file mode 100644 index 000000000..7fda8a712 --- /dev/null +++ b/tools/jackpotc/test/oldgears/.gitignore @@ -0,0 +1,3 @@ +build +dist +nbproject/private diff --git a/tools/jackpotc/test/oldgears/build.xml b/tools/jackpotc/test/oldgears/build.xml new file mode 100644 index 000000000..4234a96e6 --- /dev/null +++ b/tools/jackpotc/test/oldgears/build.xml @@ -0,0 +1,74 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- You may freely edit this file. See commented blocks below for --> +<!-- some examples of how to customize the build. --> +<!-- (If you delete it and reopen the project it will be recreated.) --> +<!-- By default, only the Clean and Build commands use this build script. --> +<!-- Commands such as Run, Debug, and Test only use this build script if --> +<!-- the Compile on Save feature is turned off for the project. --> +<!-- You can turn off the Compile on Save (or Deploy on Save) setting --> +<!-- in the project's Project Properties dialog box.--> +<project name="oldgears" default="default" basedir="."> + <description>Builds, tests, and runs the project oldgears.</description> + <import file="nbproject/build-impl.xml"/> + <!-- + + There exist several targets which are by default empty and which can be + used for execution of your tasks. These targets are usually executed + before and after some main targets. They are: + + -pre-init: called before initialization of project properties + -post-init: called after initialization of project properties + -pre-compile: called before javac compilation + -post-compile: called after javac compilation + -pre-compile-single: called before javac compilation of single file + -post-compile-single: called after javac compilation of single file + -pre-compile-test: called before javac compilation of JUnit tests + -post-compile-test: called after javac compilation of JUnit tests + -pre-compile-test-single: called before javac compilation of single JUnit test + -post-compile-test-single: called after javac compilation of single JUunit test + -pre-jar: called before JAR building + -post-jar: called after JAR building + -post-clean: called after cleaning build products + + (Targets beginning with '-' are not intended to be called on their own.) + + Example of inserting an obfuscator after compilation could look like this: + + <target name="-post-compile"> + <obfuscate> + <fileset dir="${build.classes.dir}"/> + </obfuscate> + </target> + + For list of available properties check the imported + nbproject/build-impl.xml file. + + + Another way to customize the build is by overriding existing main targets. + The targets of interest are: + + -init-macrodef-javac: defines macro for javac compilation + -init-macrodef-junit: defines macro for junit execution + -init-macrodef-debug: defines macro for class debugging + -init-macrodef-java: defines macro for class execution + -do-jar-with-manifest: JAR building (if you are using a manifest) + -do-jar-without-manifest: JAR building (if you are not using a manifest) + run: execution of project + -javadoc-build: Javadoc generation + test-report: JUnit report generation + + An example of overriding the target for project execution could look like this: + + <target name="run" depends="oldgears-impl.jar"> + <exec dir="bin" executable="launcher.exe"> + <arg file="${dist.jar}"/> + </exec> + </target> + + Notice that the overridden target depends on the jar target and not only on + the compile target as the regular run target does. Again, for a list of available + properties which you can use, check the target you are overriding in the + nbproject/build-impl.xml file. + + --> +</project> diff --git a/tools/jackpotc/test/oldgears/manifest.mf b/tools/jackpotc/test/oldgears/manifest.mf new file mode 100644 index 000000000..328e8e5bc --- /dev/null +++ b/tools/jackpotc/test/oldgears/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/tools/jackpotc/test/oldgears/nbproject/build-impl.xml b/tools/jackpotc/test/oldgears/nbproject/build-impl.xml new file mode 100644 index 000000000..80f4e3647 --- /dev/null +++ b/tools/jackpotc/test/oldgears/nbproject/build-impl.xml @@ -0,0 +1,883 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- +*** GENERATED FROM project.xml - DO NOT EDIT *** +*** EDIT ../build.xml INSTEAD *** + +For the purpose of easier reading the script +is divided into following sections: + + - initialization + - compilation + - jar + - execution + - debugging + - javadoc + - junit compilation + - junit execution + - junit debugging + - applet + - cleanup + + --> +<project xmlns:j2seproject1="http://www.netbeans.org/ns/j2se-project/1" xmlns:j2seproject3="http://www.netbeans.org/ns/j2se-project/3" xmlns:jaxrpc="http://www.netbeans.org/ns/j2se-project/jax-rpc" basedir=".." default="default" name="oldgears-impl"> + <fail message="Please build using Ant 1.7.1 or higher."> + <condition> + <not> + <antversion atleast="1.7.1"/> + </not> + </condition> + </fail> + <target depends="test,jar,javadoc" description="Build and test whole project." name="default"/> + <!-- + ====================== + INITIALIZATION SECTION + ====================== + --> + <target name="-pre-init"> + <!-- Empty placeholder for easier customization. --> + <!-- You can override this target in the ../build.xml file. --> + </target> + <target depends="-pre-init" name="-init-private"> + <property file="nbproject/private/config.properties"/> + <property file="nbproject/private/configs/${config}.properties"/> + <property file="nbproject/private/private.properties"/> + </target> + <target depends="-pre-init,-init-private" name="-init-user"> + <property file="${user.properties.file}"/> + <!-- The two properties below are usually overridden --> + <!-- by the active platform. Just a fallback. --> + <property name="default.javac.source" value="1.4"/> + <property name="default.javac.target" value="1.4"/> + </target> + <target depends="-pre-init,-init-private,-init-user" name="-init-project"> + <property file="nbproject/configs/${config}.properties"/> + <property file="nbproject/project.properties"/> + </target> + <target depends="-pre-init,-init-private,-init-user,-init-project,-init-macrodef-property" name="-do-init"> + <available file="${manifest.file}" property="manifest.available"/> + <available file="${application.splash}" property="splashscreen.available"/> + <condition property="main.class.available"> + <and> + <isset property="main.class"/> + <not> + <equals arg1="${main.class}" arg2="" trim="true"/> + </not> + </and> + </condition> + <condition property="manifest.available+main.class"> + <and> + <isset property="manifest.available"/> + <isset property="main.class.available"/> + </and> + </condition> + <condition property="do.mkdist"> + <and> + <isset property="libs.CopyLibs.classpath"/> + <not> + <istrue value="${mkdist.disabled}"/> + </not> + </and> + </condition> + <condition property="manifest.available+main.class+mkdist.available"> + <and> + <istrue value="${manifest.available+main.class}"/> + <isset property="do.mkdist"/> + </and> + </condition> + <condition property="manifest.available+main.class+mkdist.available+splashscreen.available"> + <and> + <istrue value="${manifest.available+main.class+mkdist.available}"/> + <istrue value="${splashscreen.available}"/> + </and> + </condition> + <condition property="do.archive"> + <not> + <istrue value="${jar.archive.disabled}"/> + </not> + </condition> + <condition property="do.archive+manifest.available"> + <and> + <isset property="manifest.available"/> + <istrue value="${do.archive}"/> + </and> + </condition> + <condition property="do.archive+manifest.available+main.class"> + <and> + <istrue value="${manifest.available+main.class}"/> + <istrue value="${do.archive}"/> + </and> + </condition> + <condition property="do.archive+manifest.available+main.class+mkdist.available"> + <and> + <istrue value="${manifest.available+main.class+mkdist.available}"/> + <istrue value="${do.archive}"/> + </and> + </condition> + <condition property="do.archive+manifest.available+main.class+mkdist.available+splashscreen.available"> + <and> + <istrue value="${manifest.available+main.class+mkdist.available+splashscreen.available}"/> + <istrue value="${do.archive}"/> + </and> + </condition> + <condition property="have.tests"> + <or> + <available file="${test.src.dir}"/> + </or> + </condition> + <condition property="have.sources"> + <or> + <available file="${src.dir}"/> + </or> + </condition> + <condition property="netbeans.home+have.tests"> + <and> + <isset property="netbeans.home"/> + <isset property="have.tests"/> + </and> + </condition> + <condition property="no.javadoc.preview"> + <and> + <isset property="javadoc.preview"/> + <isfalse value="${javadoc.preview}"/> + </and> + </condition> + <property name="run.jvmargs" value=""/> + <property name="javac.compilerargs" value=""/> + <property name="work.dir" value="${basedir}"/> + <condition property="no.deps"> + <and> + <istrue value="${no.dependencies}"/> + </and> + </condition> + <property name="javac.debug" value="true"/> + <property name="javadoc.preview" value="true"/> + <property name="application.args" value=""/> + <property name="source.encoding" value="${file.encoding}"/> + <property name="runtime.encoding" value="${source.encoding}"/> + <condition property="javadoc.encoding.used" value="${javadoc.encoding}"> + <and> + <isset property="javadoc.encoding"/> + <not> + <equals arg1="${javadoc.encoding}" arg2=""/> + </not> + </and> + </condition> + <property name="javadoc.encoding.used" value="${source.encoding}"/> + <property name="includes" value="**"/> + <property name="excludes" value=""/> + <property name="do.depend" value="false"/> + <condition property="do.depend.true"> + <istrue value="${do.depend}"/> + </condition> + <path id="endorsed.classpath.path" path="${endorsed.classpath}"/> + <condition else="" property="endorsed.classpath.cmd.line.arg" value="-Xbootclasspath/p:'${toString:endorsed.classpath.path}'"> + <length length="0" string="${endorsed.classpath}" when="greater"/> + </condition> + <property name="javac.fork" value="false"/> + <property name="jar.index" value="false"/> + <available file="${meta.inf.dir}/persistence.xml" property="has.persistence.xml"/> + </target> + <target name="-post-init"> + <!-- Empty placeholder for easier customization. --> + <!-- You can override this target in the ../build.xml file. --> + </target> + <target depends="-pre-init,-init-private,-init-user,-init-project,-do-init" name="-init-check"> + <fail unless="src.dir">Must set src.dir</fail> + <fail unless="test.src.dir">Must set test.src.dir</fail> + <fail unless="build.dir">Must set build.dir</fail> + <fail unless="dist.dir">Must set dist.dir</fail> + <fail unless="build.classes.dir">Must set build.classes.dir</fail> + <fail unless="dist.javadoc.dir">Must set dist.javadoc.dir</fail> + <fail unless="build.test.classes.dir">Must set build.test.classes.dir</fail> + <fail unless="build.test.results.dir">Must set build.test.results.dir</fail> + <fail unless="build.classes.excludes">Must set build.classes.excludes</fail> + <fail unless="dist.jar">Must set dist.jar</fail> + </target> + <target name="-init-macrodef-property"> + <macrodef name="property" uri="http://www.netbeans.org/ns/j2se-project/1"> + <attribute name="name"/> + <attribute name="value"/> + <sequential> + <property name="@{name}" value="${@{value}}"/> + </sequential> + </macrodef> + </target> + <target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-macrodef-javac-with-processors"> + <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3"> + <attribute default="${src.dir}" name="srcdir"/> + <attribute default="${build.classes.dir}" name="destdir"/> + <attribute default="${javac.classpath}" name="classpath"/> + <attribute default="${javac.processorpath}" name="processorpath"/> + <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/> + <attribute default="${includes}" name="includes"/> + <attribute default="${excludes}" name="excludes"/> + <attribute default="${javac.debug}" name="debug"/> + <attribute default="${empty.dir}" name="sourcepath"/> + <attribute default="${empty.dir}" name="gensrcdir"/> + <element name="customize" optional="true"/> + <sequential> + <property location="${build.dir}/empty" name="empty.dir"/> + <mkdir dir="${empty.dir}"/> + <mkdir dir="@{apgeneratedsrcdir}"/> + <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" fork="${javac.fork}" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}" tempdir="${java.io.tmpdir}"> + <src> + <dirset dir="@{gensrcdir}" erroronmissingdir="false"> + <include name="*"/> + </dirset> + </src> + <classpath> + <path path="@{classpath}"/> + </classpath> + <compilerarg line="${endorsed.classpath.cmd.line.arg}"/> + <compilerarg line="${javac.compilerargs}"/> + <compilerarg value="-processorpath"/> + <compilerarg path="@{processorpath}"/> + <compilerarg line="${ap.processors.internal}"/> + <compilerarg line="${annotation.processing.processor.options}"/> + <compilerarg value="-s"/> + <compilerarg path="@{apgeneratedsrcdir}"/> + <compilerarg line="${ap.proc.none.internal}"/> + <customize/> + </javac> + </sequential> + </macrodef> + </target> + <target depends="-init-ap-cmdline-properties" name="-init-macrodef-javac-without-processors" unless="ap.supported.internal"> + <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3"> + <attribute default="${src.dir}" name="srcdir"/> + <attribute default="${build.classes.dir}" name="destdir"/> + <attribute default="${javac.classpath}" name="classpath"/> + <attribute default="${javac.processorpath}" name="processorpath"/> + <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/> + <attribute default="${includes}" name="includes"/> + <attribute default="${excludes}" name="excludes"/> + <attribute default="${javac.debug}" name="debug"/> + <attribute default="${empty.dir}" name="sourcepath"/> + <attribute default="${empty.dir}" name="gensrcdir"/> + <element name="customize" optional="true"/> + <sequential> + <property location="${build.dir}/empty" name="empty.dir"/> + <mkdir dir="${empty.dir}"/> + <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" fork="${javac.fork}" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}" tempdir="${java.io.tmpdir}"> + <src> + <dirset dir="@{gensrcdir}" erroronmissingdir="false"> + <include name="*"/> + </dirset> + </src> + <classpath> + <path path="@{classpath}"/> + </classpath> + <compilerarg line="${endorsed.classpath.cmd.line.arg}"/> + <compilerarg line="${javac.compilerargs}"/> + <customize/> + </javac> + </sequential> + </macrodef> + </target> + <target depends="-init-macrodef-javac-with-processors,-init-macrodef-javac-without-processors" name="-init-macrodef-javac"> + <macrodef name="depend" uri="http://www.netbeans.org/ns/j2se-project/3"> + <attribute default="${src.dir}" name="srcdir"/> + <attribute default="${build.classes.dir}" name="destdir"/> + <attribute default="${javac.classpath}" name="classpath"/> + <sequential> + <depend cache="${build.dir}/depcache" destdir="@{destdir}" excludes="${excludes}" includes="${includes}" srcdir="@{srcdir}"> + <classpath> + <path path="@{classpath}"/> + </classpath> + </depend> + </sequential> + </macrodef> + <macrodef name="force-recompile" uri="http://www.netbeans.org/ns/j2se-project/3"> + <attribute default="${build.classes.dir}" name="destdir"/> + <sequential> + <fail unless="javac.includes">Must set javac.includes</fail> + <pathconvert pathsep="," property="javac.includes.binary"> + <path> + <filelist dir="@{destdir}" files="${javac.includes}"/> + </path> + <globmapper from="*.java" to="*.class"/> + </pathconvert> + <delete> + <files includes="${javac.includes.binary}"/> + </delete> + </sequential> + </macrodef> + </target> + <target name="-init-macrodef-junit"> + <macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/3"> + <attribute default="${includes}" name="includes"/> + <attribute default="${excludes}" name="excludes"/> + <attribute default="**" name="testincludes"/> + <sequential> + <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" showoutput="true" tempdir="${build.dir}"> + <batchtest todir="${build.test.results.dir}"> + <fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}"> + <filename name="@{testincludes}"/> + </fileset> + </batchtest> + <classpath> + <path path="${run.test.classpath}"/> + </classpath> + <syspropertyset> + <propertyref prefix="test-sys-prop."/> + <mapper from="test-sys-prop.*" to="*" type="glob"/> + </syspropertyset> + <formatter type="brief" usefile="false"/> + <formatter type="xml"/> + <jvmarg line="${endorsed.classpath.cmd.line.arg}"/> + <jvmarg line="${run.jvmargs}"/> + </junit> + </sequential> + </macrodef> + </target> + <target depends="-init-debug-args" name="-init-macrodef-nbjpda"> + <macrodef name="nbjpdastart" uri="http://www.netbeans.org/ns/j2se-project/1"> + <attribute default="${main.class}" name="name"/> + <attribute default="${debug.classpath}" name="classpath"/> + <attribute default="" name="stopclassname"/> + <sequential> + <nbjpdastart addressproperty="jpda.address" name="@{name}" stopclassname="@{stopclassname}" transport="${debug-transport}"> + <classpath> + <path path="@{classpath}"/> + </classpath> + </nbjpdastart> + </sequential> + </macrodef> + <macrodef name="nbjpdareload" uri="http://www.netbeans.org/ns/j2se-project/1"> + <attribute default="${build.classes.dir}" name="dir"/> + <sequential> + <nbjpdareload> + <fileset dir="@{dir}" includes="${fix.classes}"> + <include name="${fix.includes}*.class"/> + </fileset> + </nbjpdareload> + </sequential> + </macrodef> + </target> + <target name="-init-debug-args"> + <property name="version-output" value="java version "${ant.java.version}"/> + <condition property="have-jdk-older-than-1.4"> + <or> + <contains string="${version-output}" substring="java version "1.0"/> + <contains string="${version-output}" substring="java version "1.1"/> + <contains string="${version-output}" substring="java version "1.2"/> + <contains string="${version-output}" substring="java version "1.3"/> + </or> + </condition> + <condition else="-Xdebug" property="debug-args-line" value="-Xdebug -Xnoagent -Djava.compiler=none"> + <istrue value="${have-jdk-older-than-1.4}"/> + </condition> + <condition else="dt_socket" property="debug-transport-by-os" value="dt_shmem"> + <os family="windows"/> + </condition> + <condition else="${debug-transport-by-os}" property="debug-transport" value="${debug.transport}"> + <isset property="debug.transport"/> + </condition> + </target> + <target depends="-init-debug-args" name="-init-macrodef-debug"> + <macrodef name="debug" uri="http://www.netbeans.org/ns/j2se-project/3"> + <attribute default="${main.class}" name="classname"/> + <attribute default="${debug.classpath}" name="classpath"/> + <element name="customize" optional="true"/> + <sequential> + <java classname="@{classname}" dir="${work.dir}" fork="true"> + <jvmarg line="${endorsed.classpath.cmd.line.arg}"/> + <jvmarg line="${debug-args-line}"/> + <jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/> + <jvmarg value="-Dfile.encoding=${runtime.encoding}"/> + <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/> + <jvmarg line="${run.jvmargs}"/> + <classpath> + <path path="@{classpath}"/> + </classpath> + <syspropertyset> + <propertyref prefix="run-sys-prop."/> + <mapper from="run-sys-prop.*" to="*" type="glob"/> + </syspropertyset> + <customize/> + </java> + </sequential> + </macrodef> + </target> + <target name="-init-macrodef-java"> + <macrodef name="java" uri="http://www.netbeans.org/ns/j2se-project/1"> + <attribute default="${main.class}" name="classname"/> + <attribute default="${run.classpath}" name="classpath"/> + <element name="customize" optional="true"/> + <sequential> + <java classname="@{classname}" dir="${work.dir}" fork="true"> + <jvmarg line="${endorsed.classpath.cmd.line.arg}"/> + <jvmarg value="-Dfile.encoding=${runtime.encoding}"/> + <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/> + <jvmarg line="${run.jvmargs}"/> + <classpath> + <path path="@{classpath}"/> + </classpath> + <syspropertyset> + <propertyref prefix="run-sys-prop."/> + <mapper from="run-sys-prop.*" to="*" type="glob"/> + </syspropertyset> + <customize/> + </java> + </sequential> + </macrodef> + </target> + <target name="-init-macrodef-copylibs"> + <macrodef name="copylibs" uri="http://www.netbeans.org/ns/j2se-project/3"> + <element name="customize" optional="true"/> + <sequential> + <property location="${build.classes.dir}" name="build.classes.dir.resolved"/> + <pathconvert property="run.classpath.without.build.classes.dir"> + <path path="${run.classpath}"/> + <map from="${build.classes.dir.resolved}" to=""/> + </pathconvert> + <pathconvert pathsep=" " property="jar.classpath"> + <path path="${run.classpath.without.build.classes.dir}"/> + <chainedmapper> + <flattenmapper/> + <globmapper from="*" to="lib/*"/> + </chainedmapper> + </pathconvert> + <taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/> + <copylibs compress="${jar.compress}" index="${jar.index}" jarfile="${dist.jar}" manifest="${manifest.file}" runtimeclasspath="${run.classpath.without.build.classes.dir}"> + <fileset dir="${build.classes.dir}"/> + <manifest> + <attribute name="Class-Path" value="${jar.classpath}"/> + <customize/> + </manifest> + </copylibs> + </sequential> + </macrodef> + </target> + <target name="-init-presetdef-jar"> + <presetdef name="jar" uri="http://www.netbeans.org/ns/j2se-project/1"> + <jar compress="${jar.compress}" index="${jar.index}" jarfile="${dist.jar}"> + <j2seproject1:fileset dir="${build.classes.dir}"/> + </jar> + </presetdef> + </target> + <target name="-init-ap-cmdline-properties"> + <property name="annotation.processing.enabled" value="true"/> + <property name="annotation.processing.processors.list" value=""/> + <property name="annotation.processing.processor.options" value=""/> + <property name="annotation.processing.run.all.processors" value="true"/> + <property name="javac.processorpath" value="${javac.classpath}"/> + <property name="javac.test.processorpath" value="${javac.test.classpath}"/> + <condition property="ap.supported.internal" value="true"> + <not> + <matches pattern="1\.[0-5](\..*)?" string="${javac.source}"/> + </not> + </condition> + </target> + <target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-ap-cmdline-supported"> + <condition else="" property="ap.processors.internal" value="-processor ${annotation.processing.processors.list}"> + <isfalse value="${annotation.processing.run.all.processors}"/> + </condition> + <condition else="" property="ap.proc.none.internal" value="-proc:none"> + <isfalse value="${annotation.processing.enabled}"/> + </condition> + </target> + <target depends="-init-ap-cmdline-properties,-init-ap-cmdline-supported" name="-init-ap-cmdline"> + <property name="ap.cmd.line.internal" value=""/> + </target> + <target depends="-pre-init,-init-private,-init-user,-init-project,-do-init,-post-init,-init-check,-init-macrodef-property,-init-macrodef-javac,-init-macrodef-junit,-init-macrodef-nbjpda,-init-macrodef-debug,-init-macrodef-java,-init-presetdef-jar,-init-ap-cmdline" name="init"/> + <!-- + =================== + COMPILATION SECTION + =================== + --> + <target name="-deps-jar-init" unless="built-jar.properties"> + <property location="${build.dir}/built-jar.properties" name="built-jar.properties"/> + <delete file="${built-jar.properties}" quiet="true"/> + </target> + <target if="already.built.jar.${basedir}" name="-warn-already-built-jar"> + <echo level="warn" message="Cycle detected: oldgears was already built"/> + </target> + <target depends="init,-deps-jar-init" name="deps-jar" unless="no.deps"> + <mkdir dir="${build.dir}"/> + <touch file="${built-jar.properties}" verbose="false"/> + <property file="${built-jar.properties}" prefix="already.built.jar."/> + <antcall target="-warn-already-built-jar"/> + <propertyfile file="${built-jar.properties}"> + <entry key="${basedir}" value=""/> + </propertyfile> + </target> + <target depends="init,-check-automatic-build,-clean-after-automatic-build" name="-verify-automatic-build"/> + <target depends="init" name="-check-automatic-build"> + <available file="${build.classes.dir}/.netbeans_automatic_build" property="netbeans.automatic.build"/> + </target> + <target depends="init" if="netbeans.automatic.build" name="-clean-after-automatic-build"> + <antcall target="clean"/> + </target> + <target depends="init,deps-jar" name="-pre-pre-compile"> + <mkdir dir="${build.classes.dir}"/> + </target> + <target name="-pre-compile"> + <!-- Empty placeholder for easier customization. --> + <!-- You can override this target in the ../build.xml file. --> + </target> + <target if="do.depend.true" name="-compile-depend"> + <pathconvert property="build.generated.subdirs"> + <dirset dir="${build.generated.sources.dir}" erroronmissingdir="false"> + <include name="*"/> + </dirset> + </pathconvert> + <j2seproject3:depend srcdir="${src.dir}:${build.generated.subdirs}"/> + </target> + <target depends="init,deps-jar,-pre-pre-compile,-pre-compile, -copy-persistence-xml,-compile-depend" if="have.sources" name="-do-compile"> + <j2seproject3:javac gensrcdir="${build.generated.sources.dir}"/> + <copy todir="${build.classes.dir}"> + <fileset dir="${src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/> + </copy> + </target> + <target if="has.persistence.xml" name="-copy-persistence-xml"> + <mkdir dir="${build.classes.dir}/META-INF"/> + <copy todir="${build.classes.dir}/META-INF"> + <fileset dir="${meta.inf.dir}" includes="persistence.xml"/> + </copy> + </target> + <target name="-post-compile"> + <!-- Empty placeholder for easier customization. --> + <!-- You can override this target in the ../build.xml file. --> + </target> + <target depends="init,deps-jar,-verify-automatic-build,-pre-pre-compile,-pre-compile,-do-compile,-post-compile" description="Compile project." name="compile"/> + <target name="-pre-compile-single"> + <!-- Empty placeholder for easier customization. --> + <!-- You can override this target in the ../build.xml file. --> + </target> + <target depends="init,deps-jar,-pre-pre-compile" name="-do-compile-single"> + <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail> + <j2seproject3:force-recompile/> + <j2seproject3:javac excludes="" gensrcdir="${build.generated.sources.dir}" includes="${javac.includes}" sourcepath="${src.dir}"/> + </target> + <target name="-post-compile-single"> + <!-- Empty placeholder for easier customization. --> + <!-- You can override this target in the ../build.xml file. --> + </target> + <target depends="init,deps-jar,-verify-automatic-build,-pre-pre-compile,-pre-compile-single,-do-compile-single,-post-compile-single" name="compile-single"/> + <!-- + ==================== + JAR BUILDING SECTION + ==================== + --> + <target depends="init" name="-pre-pre-jar"> + <dirname file="${dist.jar}" property="dist.jar.dir"/> + <mkdir dir="${dist.jar.dir}"/> + </target> + <target name="-pre-jar"> + <!-- Empty placeholder for easier customization. --> + <!-- You can override this target in the ../build.xml file. --> + </target> + <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive" name="-do-jar-without-manifest" unless="manifest.available"> + <j2seproject1:jar/> + </target> + <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive+manifest.available" name="-do-jar-with-manifest" unless="manifest.available+main.class"> + <j2seproject1:jar manifest="${manifest.file}"/> + </target> + <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive+manifest.available+main.class" name="-do-jar-with-mainclass" unless="manifest.available+main.class+mkdist.available"> + <j2seproject1:jar manifest="${manifest.file}"> + <j2seproject1:manifest> + <j2seproject1:attribute name="Main-Class" value="${main.class}"/> + </j2seproject1:manifest> + </j2seproject1:jar> + <echo>To run this application from the command line without Ant, try:</echo> + <property location="${build.classes.dir}" name="build.classes.dir.resolved"/> + <property location="${dist.jar}" name="dist.jar.resolved"/> + <pathconvert property="run.classpath.with.dist.jar"> + <path path="${run.classpath}"/> + <map from="${build.classes.dir.resolved}" to="${dist.jar.resolved}"/> + </pathconvert> + <echo>java -cp "${run.classpath.with.dist.jar}" ${main.class}</echo> + </target> + <target depends="init,compile,-pre-pre-jar,-pre-jar,-init-macrodef-copylibs" if="do.archive+manifest.available+main.class+mkdist.available+splashscreen.available" name="-do-jar-with-libraries-and-splashscreen"> + <basename file="${application.splash}" property="splashscreen.basename"/> + <mkdir dir="${build.classes.dir}/META-INF"/> + <copy failonerror="false" file="${application.splash}" todir="${build.classes.dir}/META-INF"/> + <j2seproject3:copylibs> + <customize> + <attribute name="Main-Class" value="${main.class}"/> + <attribute name="SplashScreen-Image" value="META-INF/${splashscreen.basename}"/> + </customize> + </j2seproject3:copylibs> + <echo>To run this application from the command line without Ant, try:</echo> + <property location="${dist.jar}" name="dist.jar.resolved"/> + <echo>java -jar "${dist.jar.resolved}"</echo> + </target> + <target depends="init,compile,-pre-pre-jar,-pre-jar,-init-macrodef-copylibs" if="do.archive+manifest.available+main.class+mkdist.available" name="-do-jar-with-libraries" unless="splashscreen.available"> + <j2seproject3:copylibs> + <customize> + <attribute name="Main-Class" value="${main.class}"/> + </customize> + </j2seproject3:copylibs> + <echo>To run this application from the command line without Ant, try:</echo> + <property location="${dist.jar}" name="dist.jar.resolved"/> + <echo>java -jar "${dist.jar.resolved}"</echo> + </target> + <target name="-post-jar"> + <!-- Empty placeholder for easier customization. --> + <!-- You can override this target in the ../build.xml file. --> + </target> + <target depends="init,compile,-pre-jar,-do-jar-with-manifest,-do-jar-without-manifest,-do-jar-with-mainclass,-do-jar-with-libraries-and-splashscreen,-do-jar-with-libraries,-post-jar" description="Build JAR." name="jar"/> + <!-- + ================= + EXECUTION SECTION + ================= + --> + <target depends="init,compile" description="Run a main class." name="run"> + <j2seproject1:java> + <customize> + <arg line="${application.args}"/> + </customize> + </j2seproject1:java> + </target> + <target name="-do-not-recompile"> + <property name="javac.includes.binary" value=""/> + </target> + <target depends="init,compile-single" name="run-single"> + <fail unless="run.class">Must select one file in the IDE or set run.class</fail> + <j2seproject1:java classname="${run.class}"/> + </target> + <target depends="init,compile-test-single" name="run-test-with-main"> + <fail unless="run.class">Must select one file in the IDE or set run.class</fail> + <j2seproject1:java classname="${run.class}" classpath="${run.test.classpath}"/> + </target> + <!-- + ================= + DEBUGGING SECTION + ================= + --> + <target depends="init" if="netbeans.home" name="-debug-start-debugger"> + <j2seproject1:nbjpdastart name="${debug.class}"/> + </target> + <target depends="init" if="netbeans.home" name="-debug-start-debugger-main-test"> + <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${debug.class}"/> + </target> + <target depends="init,compile" name="-debug-start-debuggee"> + <j2seproject3:debug> + <customize> + <arg line="${application.args}"/> + </customize> + </j2seproject3:debug> + </target> + <target depends="init,compile,-debug-start-debugger,-debug-start-debuggee" description="Debug project in IDE." if="netbeans.home" name="debug"/> + <target depends="init" if="netbeans.home" name="-debug-start-debugger-stepinto"> + <j2seproject1:nbjpdastart stopclassname="${main.class}"/> + </target> + <target depends="init,compile,-debug-start-debugger-stepinto,-debug-start-debuggee" if="netbeans.home" name="debug-stepinto"/> + <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-single"> + <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail> + <j2seproject3:debug classname="${debug.class}"/> + </target> + <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-single" if="netbeans.home" name="debug-single"/> + <target depends="init,compile-test-single" if="netbeans.home" name="-debug-start-debuggee-main-test"> + <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail> + <j2seproject3:debug classname="${debug.class}" classpath="${debug.test.classpath}"/> + </target> + <target depends="init,compile-test-single,-debug-start-debugger-main-test,-debug-start-debuggee-main-test" if="netbeans.home" name="debug-test-with-main"/> + <target depends="init" name="-pre-debug-fix"> + <fail unless="fix.includes">Must set fix.includes</fail> + <property name="javac.includes" value="${fix.includes}.java"/> + </target> + <target depends="init,-pre-debug-fix,compile-single" if="netbeans.home" name="-do-debug-fix"> + <j2seproject1:nbjpdareload/> + </target> + <target depends="init,-pre-debug-fix,-do-debug-fix" if="netbeans.home" name="debug-fix"/> + <!-- + =============== + JAVADOC SECTION + =============== + --> + <target depends="init" if="have.sources" name="-javadoc-build"> + <mkdir dir="${dist.javadoc.dir}"/> + <javadoc additionalparam="${javadoc.additionalparam}" author="${javadoc.author}" charset="UTF-8" destdir="${dist.javadoc.dir}" docencoding="UTF-8" encoding="${javadoc.encoding.used}" failonerror="true" noindex="${javadoc.noindex}" nonavbar="${javadoc.nonavbar}" notree="${javadoc.notree}" private="${javadoc.private}" source="${javac.source}" splitindex="${javadoc.splitindex}" use="${javadoc.use}" useexternalfile="true" version="${javadoc.version}" windowtitle="${javadoc.windowtitle}"> + <classpath> + <path path="${javac.classpath}"/> + </classpath> + <fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}"> + <filename name="**/*.java"/> + </fileset> + <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false"> + <include name="**/*.java"/> + </fileset> + </javadoc> + </target> + <target depends="init,-javadoc-build" if="netbeans.home" name="-javadoc-browse" unless="no.javadoc.preview"> + <nbbrowse file="${dist.javadoc.dir}/index.html"/> + </target> + <target depends="init,-javadoc-build,-javadoc-browse" description="Build Javadoc." name="javadoc"/> + <!-- + ========================= + JUNIT COMPILATION SECTION + ========================= + --> + <target depends="init,compile" if="have.tests" name="-pre-pre-compile-test"> + <mkdir dir="${build.test.classes.dir}"/> + </target> + <target name="-pre-compile-test"> + <!-- Empty placeholder for easier customization. --> + <!-- You can override this target in the ../build.xml file. --> + </target> + <target if="do.depend.true" name="-compile-test-depend"> + <j2seproject3:depend classpath="${javac.test.classpath}" destdir="${build.test.classes.dir}" srcdir="${test.src.dir}"/> + </target> + <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-compile-test-depend" if="have.tests" name="-do-compile-test"> + <j2seproject3:javac apgeneratedsrcdir="${build.test.classes.dir}" classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" processorpath="${javac.test.processorpath}" srcdir="${test.src.dir}"/> + <copy todir="${build.test.classes.dir}"> + <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/> + </copy> + </target> + <target name="-post-compile-test"> + <!-- Empty placeholder for easier customization. --> + <!-- You can override this target in the ../build.xml file. --> + </target> + <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-do-compile-test,-post-compile-test" name="compile-test"/> + <target name="-pre-compile-test-single"> + <!-- Empty placeholder for easier customization. --> + <!-- You can override this target in the ../build.xml file. --> + </target> + <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single" if="have.tests" name="-do-compile-test-single"> + <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail> + <j2seproject3:force-recompile destdir="${build.test.classes.dir}"/> + <j2seproject3:javac apgeneratedsrcdir="${build.test.classes.dir}" classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" excludes="" includes="${javac.includes}" processorpath="${javac.test.processorpath}" sourcepath="${test.src.dir}" srcdir="${test.src.dir}"/> + <copy todir="${build.test.classes.dir}"> + <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/> + </copy> + </target> + <target name="-post-compile-test-single"> + <!-- Empty placeholder for easier customization. --> + <!-- You can override this target in the ../build.xml file. --> + </target> + <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single,-do-compile-test-single,-post-compile-test-single" name="compile-test-single"/> + <!-- + ======================= + JUNIT EXECUTION SECTION + ======================= + --> + <target depends="init" if="have.tests" name="-pre-test-run"> + <mkdir dir="${build.test.results.dir}"/> + </target> + <target depends="init,compile-test,-pre-test-run" if="have.tests" name="-do-test-run"> + <j2seproject3:junit testincludes="**/*Test.java"/> + </target> + <target depends="init,compile-test,-pre-test-run,-do-test-run" if="have.tests" name="-post-test-run"> + <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail> + </target> + <target depends="init" if="have.tests" name="test-report"/> + <target depends="init" if="netbeans.home+have.tests" name="-test-browse"/> + <target depends="init,compile-test,-pre-test-run,-do-test-run,test-report,-post-test-run,-test-browse" description="Run unit tests." name="test"/> + <target depends="init" if="have.tests" name="-pre-test-run-single"> + <mkdir dir="${build.test.results.dir}"/> + </target> + <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-do-test-run-single"> + <fail unless="test.includes">Must select some files in the IDE or set test.includes</fail> + <j2seproject3:junit excludes="" includes="${test.includes}"/> + </target> + <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single" if="have.tests" name="-post-test-run-single"> + <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail> + </target> + <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single,-post-test-run-single" description="Run single unit test." name="test-single"/> + <!-- + ======================= + JUNIT DEBUGGING SECTION + ======================= + --> + <target depends="init,compile-test" if="have.tests" name="-debug-start-debuggee-test"> + <fail unless="test.class">Must select one file in the IDE or set test.class</fail> + <property location="${build.test.results.dir}/TEST-${test.class}.xml" name="test.report.file"/> + <delete file="${test.report.file}"/> + <mkdir dir="${build.test.results.dir}"/> + <j2seproject3:debug classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner" classpath="${ant.home}/lib/ant.jar:${ant.home}/lib/ant-junit.jar:${debug.test.classpath}"> + <customize> + <syspropertyset> + <propertyref prefix="test-sys-prop."/> + <mapper from="test-sys-prop.*" to="*" type="glob"/> + </syspropertyset> + <arg value="${test.class}"/> + <arg value="showoutput=true"/> + <arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.BriefJUnitResultFormatter"/> + <arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,${test.report.file}"/> + </customize> + </j2seproject3:debug> + </target> + <target depends="init,compile-test" if="netbeans.home+have.tests" name="-debug-start-debugger-test"> + <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${test.class}"/> + </target> + <target depends="init,compile-test-single,-debug-start-debugger-test,-debug-start-debuggee-test" name="debug-test"/> + <target depends="init,-pre-debug-fix,compile-test-single" if="netbeans.home" name="-do-debug-fix-test"> + <j2seproject1:nbjpdareload dir="${build.test.classes.dir}"/> + </target> + <target depends="init,-pre-debug-fix,-do-debug-fix-test" if="netbeans.home" name="debug-fix-test"/> + <!-- + ========================= + APPLET EXECUTION SECTION + ========================= + --> + <target depends="init,compile-single" name="run-applet"> + <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail> + <j2seproject1:java classname="sun.applet.AppletViewer"> + <customize> + <arg value="${applet.url}"/> + </customize> + </j2seproject1:java> + </target> + <!-- + ========================= + APPLET DEBUGGING SECTION + ========================= + --> + <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-applet"> + <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail> + <j2seproject3:debug classname="sun.applet.AppletViewer"> + <customize> + <arg value="${applet.url}"/> + </customize> + </j2seproject3:debug> + </target> + <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-applet" if="netbeans.home" name="debug-applet"/> + <!-- + =============== + CLEANUP SECTION + =============== + --> + <target name="-deps-clean-init" unless="built-clean.properties"> + <property location="${build.dir}/built-clean.properties" name="built-clean.properties"/> + <delete file="${built-clean.properties}" quiet="true"/> + </target> + <target if="already.built.clean.${basedir}" name="-warn-already-built-clean"> + <echo level="warn" message="Cycle detected: oldgears was already built"/> + </target> + <target depends="init,-deps-clean-init" name="deps-clean" unless="no.deps"> + <mkdir dir="${build.dir}"/> + <touch file="${built-clean.properties}" verbose="false"/> + <property file="${built-clean.properties}" prefix="already.built.clean."/> + <antcall target="-warn-already-built-clean"/> + <propertyfile file="${built-clean.properties}"> + <entry key="${basedir}" value=""/> + </propertyfile> + </target> + <target depends="init" name="-do-clean"> + <delete dir="${build.dir}"/> + <delete dir="${dist.dir}" followsymlinks="false" includeemptydirs="true"/> + </target> + <target name="-post-clean"> + <!-- Empty placeholder for easier customization. --> + <!-- You can override this target in the ../build.xml file. --> + </target> + <target depends="init,deps-clean,-do-clean,-post-clean" description="Clean build products." name="clean"/> + <target name="-check-call-dep"> + <property file="${call.built.properties}" prefix="already.built."/> + <condition property="should.call.dep"> + <not> + <isset property="already.built.${call.subproject}"/> + </not> + </condition> + </target> + <target depends="-check-call-dep" if="should.call.dep" name="-maybe-call-dep"> + <ant antfile="${call.script}" inheritall="false" target="${call.target}"> + <propertyset> + <propertyref prefix="transfer."/> + <mapper from="transfer.*" to="*" type="glob"/> + </propertyset> + </ant> + </target> +</project> diff --git a/tools/jackpotc/test/oldgears/nbproject/genfiles.properties b/tools/jackpotc/test/oldgears/nbproject/genfiles.properties new file mode 100644 index 000000000..ece6336ba --- /dev/null +++ b/tools/jackpotc/test/oldgears/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=b54c0362 +build.xml.script.CRC32=4f6e4669 +# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. +# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. +nbproject/build-impl.xml.data.CRC32=b54c0362 +nbproject/build-impl.xml.script.CRC32=dff725e7 +nbproject/[email protected] diff --git a/tools/jackpotc/test/oldgears/nbproject/project.properties b/tools/jackpotc/test/oldgears/nbproject/project.properties new file mode 100644 index 000000000..afae06360 --- /dev/null +++ b/tools/jackpotc/test/oldgears/nbproject/project.properties @@ -0,0 +1,68 @@ +application.title=oldgears +application.vendor=mbien +build.classes.dir=${build.dir}/classes +build.classes.excludes=**/*.java,**/*.form +# This directory is removed when the project is cleaned: +build.dir=build +build.generated.dir=${build.dir}/generated +build.generated.sources.dir=${build.dir}/generated-sources +# Only compile against the classpath explicitly listed here: +build.sysclasspath=ignore +build.test.classes.dir=${build.dir}/test/classes +build.test.results.dir=${build.dir}/test/results +# Uncomment to specify the preferred debugger connection transport: +#debug.transport=dt_socket +debug.classpath=\ + ${run.classpath} +debug.test.classpath=\ + ${run.test.classpath} +# This directory is removed when the project is cleaned: +dist.dir=dist +dist.jar=${dist.dir}/oldgears.jar +dist.javadoc.dir=${dist.dir}/javadoc +endorsed.classpath= +excludes= +file.reference.gluegen-rt.jar=lib/gluegen-rt.jar +file.reference.jogl.jar=lib/jogl.jar +includes=** +jar.compress=false +javac.classpath=\ + ${file.reference.gluegen-rt.jar}:\ + ${file.reference.jogl.jar} +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.source=1.5 +javac.target=1.5 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +jaxbwiz.endorsed.dirs="${netbeans.home}/../ide12/modules/ext/jaxb/api" +main.class= +manifest.file=manifest.mf +meta.inf.dir=${src.dir}/META-INF +platform.active=default_platform +run.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +# Space-separated list of JVM arguments used when running the project +# (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value +# or test-sys-prop.name=value to set system properties for unit tests): +run.jvmargs= +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +source.encoding=UTF-8 +src.dir=src +test.src.dir=test diff --git a/tools/jackpotc/test/oldgears/nbproject/project.xml b/tools/jackpotc/test/oldgears/nbproject/project.xml new file mode 100644 index 000000000..7ab06952e --- /dev/null +++ b/tools/jackpotc/test/oldgears/nbproject/project.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project xmlns="http://www.netbeans.org/ns/project/1"> + <type>org.netbeans.modules.java.j2seproject</type> + <configuration> + <data xmlns="http://www.netbeans.org/ns/j2se-project/3"> + <name>oldgears</name> + <source-roots> + <root id="src.dir"/> + </source-roots> + <test-roots> + <root id="test.src.dir"/> + </test-roots> + </data> + </configuration> +</project> diff --git a/tools/jackpotc/test/oldgears/src/jogl111/gears/Gears.java b/tools/jackpotc/test/oldgears/src/jogl111/gears/Gears.java new file mode 100644 index 000000000..8f2cb7441 --- /dev/null +++ b/tools/jackpotc/test/oldgears/src/jogl111/gears/Gears.java @@ -0,0 +1,307 @@ +package jogl111.gears; + +import java.awt.*; +import java.awt.event.*; + +import javax.media.opengl.*; +import com.sun.opengl.util.*; + +/** + * Gears.java <BR> + * author: Brian Paul (converted to Java by Ron Cemer and Sven Goethel) <P> + * + * This version is equal to Brian Paul's version 1.2 1999/10/21 + */ + +public class Gears implements GLEventListener, MouseListener, MouseMotionListener { + public static void main(String[] args) { + + Frame frame = new Frame("Gear Demo"); + GLCanvas canvas = new GLCanvas(new GLCapabilities()); + + canvas.addGLEventListener(new Gears()); + frame.add(canvas); + frame.setSize(300, 300); + final Animator animator = new Animator(canvas); + frame.addWindowListener(new WindowAdapter() { + public void windowClosing(WindowEvent e) { + // Run this on another thread than the AWT event queue to + // make sure the call to Animator.stop() completes before + // exiting + new Thread(new Runnable() { + public void run() { + animator.stop(); + System.exit(0); + } + }).start(); + } + }); + frame.show(); + animator.start(); + } + + 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 prevMouseX, prevMouseY; + private boolean mouseRButtonDown = false; + + public void init(GLAutoDrawable drawable) { + // Use debug pipeline + // drawable.setGL(new DebugGL(drawable.getGL())); + + GL gl = drawable.getGL(); + + System.err.println("INIT GL IS: " + gl.getClass().getName()); + + gl.setSwapInterval(1); + + float pos[] = { 5.0f, 5.0f, 10.0f, 0.0f }; + float red[] = { 0.8f, 0.1f, 0.0f, 1.0f }; + float green[] = { 0.0f, 0.8f, 0.2f, 1.0f }; + float blue[] = { 0.2f, 0.2f, 1.0f, 1.0f }; + + gl.glLightfv(GL.GL_LIGHT0, GL.GL_POSITION, pos, 0); + gl.glEnable(GL.GL_CULL_FACE); + gl.glEnable(GL.GL_LIGHTING); + gl.glEnable(GL.GL_LIGHT0); + gl.glEnable(GL.GL_DEPTH_TEST); + + /* make the gears */ + gear1 = gl.glGenLists(1); + gl.glNewList(gear1, GL.GL_COMPILE); + gl.glMaterialfv(GL.GL_FRONT, GL.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, GL.GL_COMPILE); + gl.glMaterialfv(GL.GL_FRONT, GL.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, GL.GL_COMPILE); + gl.glMaterialfv(GL.GL_FRONT, GL.GL_AMBIENT_AND_DIFFUSE, blue, 0); + gear(gl, 1.3f, 2.0f, 0.5f, 10, 0.7f); + gl.glEndList(); + + gl.glEnable(GL.GL_NORMALIZE); + + drawable.addMouseListener(this); + drawable.addMouseMotionListener(this); + } + + public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) { + GL gl = drawable.getGL(); + + float h = (float)height / (float)width; + + gl.glMatrixMode(GL.GL_PROJECTION); + + System.err.println("GL_VENDOR: " + gl.glGetString(GL.GL_VENDOR)); + System.err.println("GL_RENDERER: " + gl.glGetString(GL.GL_RENDERER)); + System.err.println("GL_VERSION: " + gl.glGetString(GL.GL_VERSION)); + gl.glLoadIdentity(); + gl.glFrustum(-1.0f, 1.0f, -h, h, 5.0f, 60.0f); + gl.glMatrixMode(GL.GL_MODELVIEW); + gl.glLoadIdentity(); + gl.glTranslatef(0.0f, 0.0f, -40.0f); + } + + public void display(GLAutoDrawable drawable) { + angle += 2.0f; + + GL gl = drawable.getGL(); + if ((drawable instanceof GLJPanel) && + !((GLJPanel) drawable).isOpaque() && + ((GLJPanel) drawable).shouldPreserveColorBufferIfTranslucent()) { + gl.glClear(GL.GL_DEPTH_BUFFER_BIT); + } else { + gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT); + } + + 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); + + gl.glPushMatrix(); + gl.glTranslatef(-3.0f, -2.0f, 0.0f); + gl.glRotatef(angle, 0.0f, 0.0f, 1.0f); + gl.glCallList(gear1); + gl.glPopMatrix(); + + 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(); + + 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(); + + gl.glPopMatrix(); + } + + public void displayChanged(GLAutoDrawable drawable, boolean modeChanged, boolean deviceChanged) {} + + private void gear(GL 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(GL.GL_FLAT); + + gl.glNormal3f(0.0f, 0.0f, 1.0f); + + /* draw front face */ + gl.glBegin(GL.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(GL.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(GL.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(GL.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(GL.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(GL.GL_SMOOTH); + + /* draw inside radius cylinder */ + gl.glBegin(GL.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(); + } + + // Methods required for the implementation of MouseListener + public void mouseEntered(MouseEvent e) {} + public void mouseExited(MouseEvent e) {} + + 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 mouseClicked(MouseEvent e) {} + + // Methods required for the implementation of MouseMotionListener + public void mouseDragged(MouseEvent e) { + int x = e.getX(); + int y = e.getY(); + Dimension size = e.getComponent().getSize(); + + float thetaY = 360.0f * ( (float)(x-prevMouseX)/(float)size.width); + float thetaX = 360.0f * ( (float)(prevMouseY-y)/(float)size.height); + + prevMouseX = x; + prevMouseY = y; + + view_rotx += thetaX; + view_roty += thetaY; + } + + public void mouseMoved(MouseEvent e) {} +} + |