diff options
Diffstat (limited to 'src/jogl')
-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 |
310 files changed, 4115 insertions, 3668 deletions
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)); |